I have a custom taxonomy which has terms term1, term2, term3, term4. I also have a custom post type which has some posts. Let's say a post belongs to term1 and term 2. Now I want to show the terms in the post as:
✓term1
✓term2
✕term3
✕term4
How can I do that?
Hello,
It is possible with a taxonomy view.
See below sandbox website:
Login URL: hidden link
1) Dashboard-> Toolset-> Settings-> General,
hidden link
enable option: Show both the legacy and Blocks interface and let me choose which to use for each item I build
2) Dashboard-> Toolset-> Views, add a taxonomy view:
hidden link
- Query terms of your custom taxonomy
- disable option "Don't show empty terms"
- In view's loop, display the term information and wpv-condional shortcode, like this:
[wpv-conditional if="( CONTAINS(#(category),'[wpv-taxonomy-title]') )"]Yes[/wpv-conditional]
[wpv-conditional if="( CONTAINS(#(category),'[wpv-taxonomy-title]') )" evaluate="false"]NO[/wpv-conditional]
3) Display above taxonomy views shortcode in single post:
hidden link
[wpv-view name="show-taxonomy-terms-differently"]
Test it in frontend, it works fine:
hidden link
For your reference.
My issue is resolved now. Thank you!