We're rendering out a number of category names, but I want to exclude showing certain terms (even if I'm including the actual category type).
For example, I want to show posts that fall under both "News" and "Highlights", but I only want to render out the "News" category as text. I'd like to exclude the "Highlight" category. Is there a way to do this?
Thanks!
I received a strange message telling me I had to reinstall Types, but the plugin is working fine? I also now can't find the message.
Hello and thank you for contacting the Toolset support.
You can use conditional output to render the post only if it has the correct category, check this article https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/
To better assist you with this issue, I'll need to take a closer look at your view. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
Hi Jamal,
I may not have explained my problem well. I just need to hide the category name on the frontend, not remove the category from the post. Ergo, if something is a "Highlight" AND a "Podcast" in its categories, I only want to show Podcast and omit Highlight. Is there a way to make that happen?
This can be done using conditional shortcodes or blocks depending on whether you are building your views with the legacy views editor or with the new block editor.
Conditions can be nested and combined to get what you exactly want, check the following articles, if you still need assistance with this issue, please allow me temporary access to your website to check your use case closely.
- https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/
- https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/nesting-and-combining-conditions/
- https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/
- https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-custom-functions-in-conditions/
** Make a database backup before sharing credentials. **
All right, so I *kind* of got this working by embedding a view within a view.
hidden link If you look at the hero image and the thumbnails in the row immediately beneath it, I've managed to have it pull the category tags for articles such as "Podcast" and "News", while omitting others.
I did this by creating a view for Taxonomy that only lists the terms I want. I then embedded it in another view that makes it list for Article posts only. Buuuut now the issue is that it just lists *all* the categories, not the ones selected for a specific post. For example, both the articles for SINoALICE and Shark RPG Maneater list the same categories (I've set the limit to 3), even though they have different lists.
Can I get some help figuring this step out? Thanks.
My issue is resolved now. Thank you!
Hi Jamal,
So although I got most of what I wanted working, there is a problem I'm not sure how to resolve.
If you look at the front page here: hidden link
Posts are omitting "highlight" properly, BUT if a post is both a) not a highlight and b) a post, it displays nothing. I have no idea why. It's only set up to omit the highlight term, not all the terms, and on posts that are highlights, it omits the terms and displays the others like it's supposed to.
So as it turns out, I had to add a filter to show all categories. I'm not sure why, but it restored showing the categories while still omitting the highlights printout.