Skip Navigation

[Resolved] Altering the display of taxonomy terms

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a View of posts that includes a wpv-post-taxonomy shortcode. I would like to use more complex HTML and formatting to list the terms associated with a post, but the wpv-post-taxonomy shortcode only allows me to provide basic separators.

Solution: Use a nested View of this taxonomy instead of the wpv-post-taxonomy shortcode. Add a taxonomy term filter, set by the current post in the loop. Use the Loop Output editor to add more complex HTML and styles. Use the wpv-item, index, pad and pad-last features to make fine-grained adjustments to each iteration of the loop.

Relevant Documentation:
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
https://toolset.com/documentation/user-guides/digging-into-view-outputs/

This support ticket is created 5 years ago. 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.

Our next available supporter will start replying to tickets in about 4.31 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by edF-5 5 years ago.

Assisted by: Christian Cox.

Author
Posts
#1390367

Hi there,

I'm currently displaying a set of custom posts via a view. One of the fields on display is a taxonomy. The default display of the taxonomy is "term1, term2, term3," etc., with each term linked to a term archive page. Is there a way I can control how the terms are displayed? For example, I want to hide the comma and possibly assign CSS classes to the terms.

Here's the code in the loop item content template:

 
<p class="recently_added post_title">[wpv-post-title]</p>
<p class="recently_added publication">[wpv-post-field name="Publisher/Publication"]</p>
<p class="recently_added subject_taxonomy_terms">[wpv-post-taxonomy type="subject-terms"]</p>

Is that possible? (Do I have to nest a view inside my view?)

Thank you!

Saul

#1390719

Is that possible? (Do I have to nest a view inside my view?)
Hi, yes this is generally the best approach if you want to display each associated term with more complex formatting or extra markup. You should create a View of this taxonomy, filtered by term, where the terms are set by the current post in the loop. Then use the Loop Output editor to add your custom HTML markup and CSS classes as needed. Insert this View in your existing View of posts in the loop editor. Let me know if you need additional information about that approach and I can give more guidance.

#1393809

This makes sense. I'll give it a shot.

Thanks, Christian!

Saul