Bootstrap Templates Bundle

Saturday, August 15, 2015

HOW TO REMOVE EMPTY PARAGRAPH TAGS FROM SHORTCODES IN WORDPRESS

Simply drop the following code in your theme’s functions.php file and Enjoy! No more annoying empty paragraphs tags in your content.

add_filter( 'the_content''tgm_io_shortcode_empty_paragraph_fix' );
/**
 * Filters the content to remove any extra paragraph or break tags
 * caused by shortcodes.
 *
 * @since 1.0.0
 *
 * @param string $content  String of HTML content.
 * @return string $content Amended string of HTML content.
 */
function tgm_io_shortcode_empty_paragraph_fix( $content ) {
    $array array(
        '<p>['    => '[',
        ']</p>'   => ']',
        ']<br />' => ']'
    );
    return strtr$content$array ); 
}

1 comment:

  1. It means 'the last part of this url is a filename, not a directory' and so in our example, a crawl starting at www.my-wordpress-site. psd to wordpress

    ReplyDelete

Wokiee React eCommerce Template