Navigation überspringen

[Gelöst] Show taxonomy terms differently

This support ticket is created vor 3 years, 1 month. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zeitzone des Unterstützers: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von fahimS-2 vor 3 years, 1 month.

Assistiert von: Luo Yang.

Author
Artikel
#2596061

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?

#2596733

Hello,

It is possible with a taxonomy view.

See below sandbox website:
Login URL: versteckter Link

1) Dashboard-> Toolset-> Settings-> General,
versteckter 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:
versteckter 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:
versteckter Link
[wpv-view name="show-taxonomy-terms-differently"]

Test it in frontend, it works fine:
versteckter Link

For your reference.

#2598129

My issue is resolved now. Thank you!