Blog Archive Layout with Condition - Not all posts displayed on first page

Hi there, I have 2 questions:

  1. I have created a blog archive with the layout builder. WP read setting for posts is 9 items, the Looper Consumer is set to “All”. Works fine. But I don’t want posts of a category (News) to be displayed, because I have a separate layout for this category. The condition is: “Post (has) term - has not - News”. Works fine and no posts from the category News are displayed. But as soon as I specify this condition, only 5 articles (from the other categories) are displayed on the first page of the blog archive, although there are more articles on the following page. The same thing happens when I exclude another category via the condition.

  2. I have added some term buttons. When you click on them, you only see articles from that category. Since “News” is also a category, the button for “News” is also shown. How is it possible to exclude the button of this category?

Thanks for the help.

Hello @ronaldo304,

Thanks for writing in!

Using this condition in your Blog index layout will only hide away the post item/s.

It will not modify the WordPress loop. The WordPress loop STILL returns 9 items but then you have added a condition not to show the post with the News category. This is why only 8 items were displayed.

If you truly want to exclude the News category from the blog index, you will have to modify the WordPress Loop. Please check out this article instead:

Kindly let us know how it goes.

Hi, Thanks.
hm, that’s pretty weird. What sense does it make in this case to hide a category “visually” but not “physically”? Anyway. I put the php code in the function.php and it works. So other than additional extra php code there is no way with on-board resources to hide a category with Pro, is that correct?

What about my 2nd question, the category buttons? This is a looper provider “All terms”, taxonomy “categories”.
Thank you.

Hi @ronaldo304,

You need to use the condition where you are showing the Categories to exclude the specific category as shown in the given screenshot.

I have also created a Test page with a similar condition, you can replicate the same wherever it is needed.

Hope it helps.
Thanks

Thank you very much @tristup

That was the hint in the right direction. I had to make some adjustments for the buttons. With your setting - column is looper and consumer at the same time - the category “News” is no longer visible, but the empty div container was still visible in the source code.

For other forum users - here are settings for a term / category button loop and exclude a special defined category.

Hi @ronaldo304,

Glad that we are able to help you with this. And thanks for that you shared the solution with others.

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