Inside app/controllers/App.php, I added
protected $acf = true;
which allows
{{ $field_name }}
to be outputted for my page-name.blade.php
templates.
But when I’m using archive-name.blade.php
(with CPTUI archive on), the
{{ $field_name }}
no longer works.
It seems like for archive pages, the controller is acting differently. Any ideas?
I’m starting to think ACF can’t be used with archive, but only pages. ACF conditional only has option for pages. How can we add non-post ACF fields to an archive template?
I found this workaround, let me know if you can think of another way. So I want to display a page specific ACF field (non-post/non-loop) in an archive page. I first create the ACF field & show it on a page for edit, then inside the archive template, grab the page ID & then the ACF field that way.
But how can I add the field values to the page post type in the controller?