How to: Create an Accordion Using Advanced Custom Fields Pro Repeater Field and Bootstrap

11th October 2018

A bit niche, but may be a useful snippet of code for some. First I’ve setup a repeater field in ACF Pro, and called it ‘accordion’. The sub fields are ‘title’ and ‘content’. The title sub field is going to label the accordion button that controls the toggle, the content sub field is what drops out. Then in the page template within my theme, I’m adding this code:

Of course, this relies on you already having called the Bootstrap stylesheet and other dependencies, but I’m guessing you won’t be looking at this unless you’re already working with it.

Leave a Reply

What our customers say:

Jo has been looking after my website for a couple of years now. She has just completed another refresh of the site for me, tidying up a few pages and installed a fantastic new booking system that has made a huge improvement to the functionality of the site. I’m really pleased with the result, and the website looks great. I can highly recommend Jo for all your website needs.

Andrew Tee (Get More Adventure)