Issues with Blog Page in WordPress and The Archive Layouts

We currently publish blog posts and case studies in ‘Posts’ in WordPress. In Pro, I created two archive layouts - one is for the blogs and the other for case studies. I was hopeful that Pro would filter ‘blogs’ and ‘case studies’ from WordPress’s blog to their respective archives using assignment/conditions. After reading a few posts on this forum - in particular, this one (Assigning layout to specific page OR creating more than one blog archive). Here is what I understand:
In order for pagination to work, you have to use an archive. In order for blogs to populate on that archive layout, you have to designate a ‘Posts page’ in WordPress, meaning you can only have one blog archive.
So to confirm, you can’t have more than one archive retrieving content from Posts in WordPress, correct?

If this is correct, how would you recommend displaying a variety of case studies?

Hello John,

Thanks for posting in! I my understanding, you have created post items and categorized them as blog post and case studies. This should NOT be the case. The blog post items and case studies should NEEDS to be a seperate independent post types. Anyways, since you already have this set up, they only way I can think of is to use a custom PHP code that filters out post items under the case studies category. The pre_get_post action hook can help with this one. take a look at these threads:

Be advised that I am just assuming that you used categories in separating the post items. So the layout archive can be used to display the items. With the help of the custom PHP code it should work. At the moment, you would be seeing the items in these possible archive pages:

  • Blog Index: displays both blog posts and case studies
    https://example.com/blog/ assuming the blog index page is entitled “blog”

  • Blog Category: displays all items under blog category
    https://example.com/category/blog/

  • Case Studies Category: displays all items under case study category
    https://example.com/category/case-studies/

All of these pages can use the same archive layout. If you want a different layout for the case studies then you can create another archive and assigned it specifically to the case study category.

We would very much love to check your site if you would allow us to log in. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Hello John,

Thanks for sharing the login details I would suggest you please set the condition like this on the blog archive page so it will exclude the post from the specific category.

I noticed that you have created a custom archive layout for the specific category but you have set the Looper provider there, I would suggest you please use the Looper consumer and recheck it. Please note that you don’t need an extra loop on the archive page since the WordPress default Loop is working there.

Thanks