Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

WordPress Content Accordion WordPress

  • SOLVED

Hello I am using this WordPress Accordion (http://patrick.forringer.com/2011/04/wordpress-content-accordion/) on a site that i'm making, its all looking and working fine apart from the first accordion always stays open.

Ideally all accordions should be closed unless clicked to be open. On page load all accordions should be closed.

Can anyone help me with this?

Url for my site is in attached image. On the page the first accordion is 'Get Ahead'

Thanks

Answers (2)

2013-04-03

Dbranes answers:

It seems to work if you remove the p-tag around the content

<p>&nbsp;<br />

and

</p>

<strong>Edit:</strong> Try this filter, just to see if it works for you also to skip the p-tags:

remove_filter ('the_content', 'wpautop');

<strong>Edit 2:</strong>

Here is another work-around:

<div>
[accordion title="I belond to group 1" group="special"]your content here[/accordion]
[accordion title="I'm special" group="special"]your content here[/accordion]
[accordion title="I belong to group 1 as well" group="special"]your content here[/accordion]
[accordion title="Your Title Here" group="special"]your content here[/accordion]
</div>


i.e. you add a div around the shortcodes.


Dbranes comments:

Good to see it's working on the site now, with the extra div wrapper ;-)

2013-04-03

Arnav Joy answers:

how you have added content ?


Ross Gosling comments:

Using the shortcode [accordion title="Your Title Here" ]your content here[/accordion]