ACF repeater fields in Bricks while using CPT's

ACF repeater / Bricks / CPT

I recently made a FB post in the user group that I could not get ACF repeater fields to display on the front end of my websites - when the condition inside ACF is they are shown in a CPT on the backend. For some reason, if I display the ACF repeater on pages on the backend, I have no issues displaying the custom field wherever I want on my website on the front end.

A fellow member pointed out to me, it can if you output it inside of a template in Bricks. This works, but you can ONLY display the data on a template. It stops working when you put the template on a page. Why? And how to solve it?

Does anyone have an answer to what this is? Am I trying to do something that is not possible? Why can’t I output ACF repeater fields when they are inside of a CPT - yet I can when I add them to pages on the backend?

So to be clear, if I change the image underneath to a CPT, I can’t output the repeater, unless it’s on a template. Which is useless to me in practice.

The use case btw is I want to recreate my Oxygen website https://eetcafedepreuverij.nl/ into Bricks builder and have the (food) menu repeater neatly organized in the backend under a CPT called “Food Menus” to have clients being able to adjust their own menu, in a logical place — instead of the repeater appear on pages.

If the repeater is in a cpt, by default you can only pull it inside the template for the specific post cause that’s what the data is “bound” to. Personally I’d just create an options page which you can organize with tabs for various repeaters or just one single repeater depending on the menu you’re looking to build. Then you can pull it in anywhere.

1 Like

Tnx, that clears up a lot for me.

That is a great idea! I don’t need a CPT per se, but I’d like a WP menu-icon and disable the Title and editor on that specific page. Is that doable for a single page to your knowledge?

If you add an options page it will show up in the regular dashboard menu of wp without a title or editor field. Then just set your acf field group to be shown on that options page, fill it and use a query loop to show it whereever you want it.

There are plugins to add options pages but it’s such a tiny snippet that I’d personally just add it to the functions as shown here: ACF | Options Page

1 Like

Excellent. You just solved in minutes what I’ve been looking for weeks bothering other people :slight_smile: