Archived topic
Accordian
6 replies · Started by Darren on August 21, 2019
Hi, I am trying to implement this accordian solution found on https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_accordion_animate
Unfortunately the accordian doesn't open on my GP site, I added the javascript via a Hook element in wp_footer not sure why it doesn't open?
Thanks
Darren
This is happening because WordPress is adding <p> elements around the buttons, which is breaking the JS.
If you're using Gutenberg, try adding the HTML into an HTML block instead.
Thanks Tom, with the javascript placed in the header or footer it wasn't working, but it's working if I use after_main_content, elements to the rescue! thanks:)
Awesome, glad you got it working :)
hi tom, although not GP related I'm having issue on my faq page when the columns of the accordian doesn't have a matching number of rows on each side is there a css fix for this possibly?
Not to worry I just place the unequal columns last. Looks fine now.
Cool :)