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

    (@philbuchanan)

    This may be an issue with the wpautop.

    Try removing all space from around your shortcodes. Example:

    [accordion]
    
    [accordion-item title="Title of accordion item"]
    
    Dropdown content goes here.
    
    [/accordion-item]
    
    [accordion-item title="Second accordion item"]
    
    Dropdown content goes here.
    
    [/accordion-item]
    
    [/accordion]

    Would become:

    [accordion][accordion-item title="Title of accordion item"]Dropdown content goes here.[/accordion-item][accordion-item title="Second accordion item"]Dropdown content goes here.[/accordion-item][/accordion]
    Thread Starter bdew

    (@bdew)

    Ah Ha! This explains some weirdness I’ve seen with other short codes.

    I simply ran the closing and opening shortcodes together like this:

    [/accordion-item][accordion-item title="Ladies' section" tag="h2"]

    and problem solved. Many thanks.

    Plugin Author philbuchanan

    (@philbuchanan)

    Glad that solved the problem.

    You can also remove the weird formatting from all shortcodes by adding these lines to your functions.php file:

    remove_filter( 'the_content', 'wpautop' );
    add_filter( 'the_content', 'wpautop' , 99);
    add_filter( 'the_content', 'shortcode_unautop',100 );

    Keep in mind this might have other effects on your content layout so you’ll want to test it before moving it into live site environment.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I reduce the vertical spacing of Accordion’ is closed to new replies.