I'm using ACF to create pages with separate flexible layout sections in two areas, the main page section area and a sidebar area.
I have a CPT called case-studies
and have created a page called case-studies
. I have set 'has_archive' => false,
within the CPT in the hope that the page is used however (and I understand) that there is a hierarchy to this so that if no archive is given, then it will load my home.php (which is what I am using for my news, the posts post type).
Is there any way for a page to be used as an archive for a CPT? The only solution I can see at the moment is to use the ACF CPT Options Pages plugin and attached the ACF fields I have created to my 'Case Studies Archive' page however, I would have to duplicate all of my code so that they can called the right content. For example:
the_field('field_name');
to the_field('field_name', 'cpt_case-studies');
Has anyone been able to use a page as an archive for a CPT and assign a template to the page which both queries the CPT posts and have the ACF fields from the page?
Thanks very much for your help. If there is anything else I can supply, let me know.