Leveraging AI to Supercharge Your WordPress Business Website
In today’s competitive digital landscape, every business website needs an edge to...
24.Jun.2017 | Code Snippets, Wordpress
A quick way to remove empty p tags from custom shortcodes in WordPress.
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
$block = join("|",array("shortcode1","shortcode2","shortcode3"));
$rep = preg_replace("/( <p> )?\[( $block )(\s[^\]]+)?\](<\/p>|<br \/>)?/", "[$2$3]", $content);
$rep = preg_replace("/( <p> )?\[\/( $block )](<\/p>|<br \/>)?/","[/$2]",$rep);
return $rep;
}
Credit: https://gist.github.com/bitfade
PHP, Wordpress Function, WordPress Tips
Share
In today’s competitive digital landscape, every business website needs an edge to...
WordPress has come a long way since its humble beginnings in 2003....
In the ever-evolving landscape of website development, staying ahead of the curve...
Here is a really simple way to create custom tabs for your WooCommerce builds using the ACF Repeater Field. First,...
Commonly asked eCommerce questions: A nice little bit of information about #PCIDSS for @WooCommerce - http://goo.gl/BSK6Ba Lee Harris - Twitter...
Handy bit of code you can use in your custom templates that grabs the all the page or post data by ID:...