Support » Plugin: Accordion Shortcodes » Spacing Between Accordion

  • Resolved jklapr

    (@jklapr)


    Before I complete the page, was wanting to fix the large spacing between each item. Need them to be stacked with just a normal paragraph spacing between each.

    Here’s the code:
    [accordion clicktoclose=”true”]
    [accordion-item title=”$1,000,000 and above”]Anonymous Foundation
    The Rees-Jones Foundation 
    [/accordion-item]
    [/accordion]
    [accordion clicktoclose=”true”]
    [accordion-item title=”$999,999-$250,000″]
    Pioneer Natural Resources[/accordion-item]
    [/accordion]
    [accordion clicktoclose=”true”]
    [accordion-item title=”$249,999-$100,000″]
    Anonymous
    The Patrick and Beatrice Haggerty Foundation
    Hillcrest Foundation
    ORIX Foundation
    The Simmons Family Foundation
    The James and Angela Thompson Foundation[/accordion-item]
    [/accordion]

    Website page – http://www.dallascasa.org/about-us/our-donors/

    https://wordpress.org/plugins/accordion-shortcodes/

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

    (@philbuchanan)

    This is a common issue with WordPress. It automatically adds extra spaces around shortcodes. I use this function in my themes functions.php to fix it:

    /**
     * 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');

    Alternatively, you can remove all line breaks from your shortcode block, although this is not always ideal.

    Opps! I’ve entered this post in the wrong thread. Please delete.

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