Tell us what you are trying to do?
I have created a custom post and a custom taxonomy (custom post category) which in turn has 4 category items. I want to display posts that belong only to one out of the four of category items. I have been using views and conditional blocks. I created four checkbox custom field, one for each category items, and assigned to that custom post type. I have used a conditional display rule for only the posts with the selected category item checked to be shown. However, the output delivers all the posts of that taxonomy (ie everything that is assigned to any of the four category items).
Is there a way to dynamically display specific posts that belong to one category item only? Can you please clarify the steps for doing so?
Is there any documentation that you are following?
https://toolset.com/2021/08/5-advanced-uses-of-toolsets-conditional-block-in-wordpress/
Hi,
Thank you for contacting us and I'd be happy to assist.
For this kind of filtering, you don't have to use the conditional block.
As shown in the attached screenshot, you can include a taxonomy filter in the view's query filter settings, so that the target term's slug can be passed in the view's shortcode attribute.
After that, you'll be able to use the same view to show posts from different taxonomy terms, by just changing the shortcode attribute value.
For example, to show the results associated with the term with slug "term-1-slug", the shortcode of the view would be:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-view )
[wpv-view name="view-name" wpvcategory="term-1-slug"]
Likewise, to show the results from the term with slug "term-2-slug", the shortcode would become:
[wpv-view name="view-name" wpvcategory="term-2-slug"]
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
My issue is resolved now. Thank you!