Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter junkpad92

    (@junkpad92)

    Fixed it by adding this to my functions.php

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I’m not really sure where those are coming from. TablePress is not adding them, so I assume it’s e.g. the WordPress wpautop() function.

    Please check if the Shortcode stands by itself on its own line, without extra spaces around it. For that, please go to the “Edit” screen of the post/page in question, and switch from the “Visual” to the “Text” editor in the upper right corner of the editor window.

    Regards,
    Tobias

    Thread Starter junkpad92

    (@junkpad92)

    Hey,

    thanks for your answer!

    Yes, there is a bug in WordPress: https://core.trac.www.ads-software.com/ticket/12061 – for 5 years!

    I fixed it by added the posted function to my functions.php.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    yeah, that one is a bit ugly…
    Good to hear that you found a workaround for your site!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Empty p (paragraphs) before and after tables’ is closed to new replies.