Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author philbuchanan

    (@philbuchanan)

    WordPress often adds empty paragraphs and line breaks around shortcodes. You can fix that by adding this to your 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');

    Once you have added that, you can use CSS to achieve the actual amount of spacing you want between accordion items. For example:

    .accordion-content {
        margin-bottom: 10px;
    }

    I know I didn’t ask the question, but this worked perfectly for me. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Spacing Issue’ is closed to new replies.