Remove auto added

from a page that has no literal content (uses shortcodes)

后端 未结 5 677
我在风中等你
我在风中等你 2021-01-05 07:16

I have a WordPress powered website that on the homepage uses a static page with nothing but shortcodes to generate the content.

The page gets these shortcodes by set

5条回答
  •  一整个雨季
    2021-01-05 07:26

    Try this(paste this code somewhere in functions.php):

    function shortcode_empty_paragraph_fix($content){   
        $array = array (
            '

    [' => '[', ']

    ' => ']', ']
    ' => ']' ); $content = strtr($content, $array); return $content; } add_filter('the_content', 'shortcode_empty_paragraph_fix');

提交回复
热议问题