Hi, I need help with the archive layout. I have set up a layout for the blog, and it works fine. But when I navigate to a category (ffor example “eventi”), are displayed not only the “eventi” posts, but all of them (except for those I have deliberately excluded). “Summer Camp” and “Online Courses” are archives that have a different layout and should not appear on the blog. Where am I going wrong?
Hello @dcheese,
Thanks for writing to us.
I checked your archive layout it seems that you have set the Looper provider as a query builder, please note that when you set the Looper provider on your layout it means it will display the posts which are been put in the Looper. I would suggest you please create a separate archive layout for the category archive page and set this layout to your category. Please note that you need to set the Looper provider as OFF and use Looper Consumer only since on the archive page the default WordPress Looper is working so you don’t need an extra Loop there.
Hope it helps
Thanks
Thank you! So is there a way to exclude two (or more) categories from the blog archive?
Thank you for the update.
You may need to create another Archive Layout specifically for the blog or journal page, then use the Looper Provider > Query Builder to control the visibility of the items or posts by selecting specific terms or categories. Another option is to use the pre_get_posts hook.
– https://developer.wordpress.org/reference/hooks/pre_get_posts/
If you’re interested with this type of modifications, please check out our One service.
Let us know if you need more info.
Best regards.