Accordian no longer collapsing

I saw this post: https://theme.co/apex/forum/t/accordian-is-not-collapsing-after-cornerstone-update/25904

I have the same problem (accordians should only open one item at a time, but multiple items remain open instead), but everything is up to date. Cornerstone 3.0.4 and X Theme 6.0.4.

What can I do to fix it?

Thanks,

Dean

Hi @dean44,

Thanks for writing in.

Enable grouping so that your other accordion will close after clicking other Accordions items.

Use link items for classic accordions.

If still not helping, please share us your admin credentials so we could check your setup closer. Don’t forget to set it as private reply.

Thanks.

Actually, I’m using shortcodes to create the Accordians. The documentation here: http://demo.theme.co/renew-1/shortcodes/accordion/ states that assigning the parent_id will keep one item open at a time, and it used to work.

“parent_id: match the ID of the parent accordion to keep only one accordion item open at a time.”

Would something have changed in one of the latest updates that the shortcodes wouldn’t work?

Hi there,

Yes, it’s changed. The format should be like this

[x_accordion link="true" ][x_accordion_item title="Accordion Item 1" open="true"]Add some content to your accordion item here.[/x_accordion_item][x_accordion_item title="Accordion Item 2" open="false"]Add some content to your accordion item here.[/x_accordion_item][/x_accordion]

Where parent_id now become link="true", no need for ID. The accordion can now linked together where it opens one at a time only.

Thanks!

Thank you! Your help with this is much appreciated.

I would like to register a complaint though, because I use this shortcode extensively on my site (hundreds of times) and so changing my site now is going to be very costly. I’m disappointed that this change is not backwards compatible and that it wasn’t documented on the page I referenced.

Hi there,

The accordion shortcode should be backward compatible and I can confirm this with my test setup.

Try using it like this:

[accordion id="my-accordion" link="true"]
    [accordion_item title="Accordion Title"]Your text here[/accordion_item] 
    [accordion_item title="Accordion Title" open="true"]Your second accordion text[/accordion_item]
    [accordion_item title="Accordion Title"]Your third accordion text[/accordion_item]
[/accordion]

Hope this helps.

Hi,

But that is using the new shortcode format, not the old. I meant that the old shortcode should still function properly even if you changed to a new shortcode. Your example on http://demo.theme.co/renew-1/shortcodes/accordion/ does > NOT keep only one item open at a time. eg:

[accordion id="my-accordion"] 
[accordion_item title="Accordion Title" parent_id="my-accordion"]Your text here[/accordion_item] 
[accordion_item title="Accordion Title" parent_id="my-accordion" open="true"]Your second accordion text[/accordion_item] 
[accordion_item title="Accordion Title" parent_id="my-accordion"]Your third accordion text[/accordion_item] 
[/accordion]

Hi,

Regretfully, that will no longer work. I will forward this to our web development team for review.

For a temporary fix kindly add the code below in your child theme’s functions.php file.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.