Skip Navigation

[Resuelto] Custom taxonomy term links with wpv-post-taxonomy

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem: I would like to list the taxonomy terms associated with a post, and format them as links. However, when I use the wpv-post-taxonomy shortcode to display links, the URLs point to the term archive. I would like to link to a custom post URL instead, where the post slug matches the term slug.

Solution: Assuming the Brand term slugs and their corresponding Tour Operator post slugs are identical, you can do this by replacing the wpv-post-taxonomy shortcode with a View of the Brand Taxonomy. Add a Query Filter, filtered by term, where the term is set by the current post in the loop. In the Loop Output of this View you can construct link tags using a combination of HTML and Views Shortcodes, like this:

<a href="/tour-operator/[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a>

Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-slug

This support ticket is created hace 5 años, 10 meses. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. 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)

This topic contains 2 respuestas, has 2 mensajes.

Last updated by Daniella hace 5 años, 10 meses.

Assisted by: Christian Cox.

Autor
Mensajes
#729654

Hi,
I have the following View on the homepage, hidden link
<div class="repost"><h3><a href="[wpv-post-field name="wprss_item_permalink"]">[wpv-post-title]</a></h3>
<p>[wpv-post-taxonomy type="brand" separator=", " format="link" show="name" order="asc"]</p></div>

This is listing recent posts in a CPT called Repost that has a Brand Taxonomy. This taxonomy is listing the brand. However, this brand is also the same as a CPT called Tour Operator. What I would like to do is have the Brand link to the Tour Operator page. For example, on this link:
The Other Face of Molokai
UnCruise Adventures

Uncruise Adventures will link to hidden link NOT, hidden link as it is doing now.

How can I do this?
Thanks!

#730537

Hi, assuming the Brand term slugs and their corresponding Tour Operator post slugs are identical, you can do this by replacing the wpv-post-taxonomy shortcode with a View of the Brand Taxonomy. Add a Query Filter, filtered by term, where the term is set by the current post in the loop. In the Loop Output of this View you can construct link tags using a combination of HTML and Views Shortcodes, like this:

<a href="/tour-operator/[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a>

We have some shortcode documentation available here for your reference:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-slug

#737631

Thank you so, so much!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.