shortcode - Wordpress Creating Empty <p> Tags? -


it seems wordpress creating empty p tags no reason whatso ever. correct problem getting rid of white space - white space seems interpreted "p tag here! place p tag here".

here wordpress dashboard content concerned with:

[block]<p>this test</p>[/block] 

as can see there no whitespace.

here html representation of same piece of html.

<div class="block sidebar"> <p>this test</p> <p></p></div> 

see second <p></p> there no reason?

can please tell me why happens , how (if @ all) can remedy situation?

i created shortcode [block] , have been using on other pages without problem. seems page specific (because makes sense..not).

any appreciated. can provide link page if necessary. let me know.

how dashboard looks:

enter image description here

add functions.php , fix problem

add_filter('the_content', 'shortcode_empty_paragraph_fix'); function shortcode_empty_paragraph_fix($content) {     $array = array(         '<p>['    => '[',         ']</p>'   => ']',         ']<br />' => ']',         ']<br>'   => ']',     );      $content = strtr($content, $array);      return $content; } 

Comments