• Resolved DaysWorkDesign

    (@barbaraday)


    There is a <br> tag being inserted at the beginning of the accordion content. Am making sure there are no hard returns (or any spaces at all) between the close of the shortcode and the beginning of the content. This does not happen for the first accordion item, then the <br> tag is inserted for all of the rest of the items after the first one.

    It can be seen with Chrome dev tools and also as extra whitespace above the text when the accordion is open.

    This is a great plugin! Just hoping there’s a fix for this.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author philbuchanan

    (@philbuchanan)

    This is a limitation of how the editor works with shortcades. The only fix I have been able to find is adding this to your themes functions.php file:

    /**
     * Fixes empty <p> and <br> tags showing before and after shortcodes in the
     * output content.
     */
    function pb_the_content_shortcode_fix($content) {
        $array = array(
            '<p>['    => '[',
            ']</p>'   => ']',
            ']<br />' => ']',
            ']<br>'   => ']'
        );
        return strtr($content, $array);
    }
    add_filter('the_content', 'pb_the_content_shortcode_fix');
Viewing 1 replies (of 1 total)
  • The topic ‘Break tag inserting at start of accordion content’ is closed to new replies.