Hi Ive been trying to use the post object field type to select a custom post type master archive page. For example my custom post type if casestudies which lists all single casestudies, but i cant work out how to select the archive page that shows all casestudies. Is this possible?
What you’re looking to do cannot be done with the post object field, not that I’m entirely sure what you’re trying to do. An archive page has nothing in the db, or an admin page. While it exists on the front of the site an archive page does not really exist in any real form.
Maybe it would help if you explain why you want to select the archive page.
Thanks for response. Apologies if not explained myself clearly, i’m confusing myself,! I think i need to learn more about basic template hierarchy foremost. B
Basically i want to pick the page that loops through the casestudies. Currently that page is a archive-custom.php file and works ok. But i think i might need to create a custom page template that loops through that archive page instead.
Yes, the WP template hierarchy can be one of the difficult things to understand. I’ve tried to explain archive pages to clients and even to the people I work with/for. “I can see the page on the front end, why can’t I change the content?”
Anyway, if you are wanting to show the list of case studies on the front end than the template you mentioned, well I don’t know what file
archive-custom.php is. If you’re custom post type is
case-study then I would expect it to be
archive-custom.php a file that is supplied by the theme you’re using?
What do you want to do with the archive template file that it’s not doing.
Having the same issue here and do not really want to change the ACF field to a post field. As a last case scenario, you could create a page that then redirects to the custom post archive page.
In my scenario, I was creating a directory page listing all of the common types of pages I’d want to be linking to. Therefore the custom post type archive page was one of them.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.