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:

I knew the moment I spoke to Jo that she was the right person to transfer our website over to a content management system.  We were looking for someone who combined a really good technical knowledge of WordPress with a keen eye for design, and Jo provided just that.  She was fast, thorough and incredibly straightforward in her approach and nothing was too much trouble.  The training Jo delivered as part of the job was clear and thorough too.  Thank you, Jo, for a fantastic job!

Tessa Lamb (Business Language Training)