Creating a post archive with ACF and Cornerstone

Hi there,

I think I am doing something wrong with my ACF custom post types and the Cornerstone Archive layout – I can get the page to show the posts, but the category links and the links to the posts themselves on the archive do not work properly – can you please help?

I want to be able to create a section that acts like the blog with post pagination (so there would only be max X no. of posts per page) and also be able to navigate to the categories for this custom post type, like you would in the blog. It looks like it would be achievable but I am clearly doing something wrong.

Details in the secure note. Thanks!

Hello @RossDueNorth,

Thanks for writing in!

Please edit your custom layout and make sure to disable the Looper Provider. Only the Looper Consumer is needed on archive layouts.

By the way, we have not logged in to the site because the password is incorrect.

Best Regards.

Hi @ruenel thanks for coming back!

Firstly I have updated the password in the secure note – apologies this was my mix up.

I tried making an archive layout initially but I couldn’t work out how to assign this to a page – the “blog” where normal posts will live is different, this is a section of the site for custom post types using ACF. I assume it’s something obvious I am missing!

Cheers

Hello @RossDueNorth,

Just as I suspected, you have a Looper Provider in your archive layout:

You need to disable the Looper Provider. Only the Looper Consumer is needed when using the archive layout.

I also noticed that you have this Condition:

The condition above will not work for your Case Studies. You should be using this condition instead:

And lastly, you have a SLUG case-studies that is in conflict:

If you go to https://example.com/case-studies/, WordPress will get confused about which one to display, the Case Studies page or the Case Studies custom post type archive. You will have to change the slug on one of them to prevent conflict.

Best Regards.

Ahh this is why I couldn’t get it to work – the conflicting slug was the problem. Thanks for spotting it, appreciate your help @ruenel I knew it was something I had done wrong!

You are most welcome @RossDueNorth

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.