Skip Navigation

[Resolved] Trying to create custom urls from taxonomy slug

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

Problem: I would like to create a list of links based on the slug of each term assigned to a post. The wpv-post-taxonomy shortcode separator feature doesn't help.

Solution: Create a View of this taxonomy, filtered by term assigned to the current post or by term assigned to the current post in the loop. Then use the Loop editor to build each link using shortcodes and HTML, for example:

<a href="https://mysite.com/#[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a>

Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/

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

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 herreV 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1141269

Hello i'm trying to displaying category names linked to a post.

For sure the normal approach works.

But what i would like to create is a list of names that do link to a custom page url.

E.g. My post contans the following categoy values: cat1, cat2, cat3

Then i would like to create the following output:
<a href="mywebsite.com#cat1">cat1</a> <a href="mywebsite.com#cat2">cat2</a> <a href="mywebsite.com#cat3">cat3</a>

So instead of a link to the taxonomy archive i need to create links that do link to a URL and added #category-slug

Can you please send me in the right direction... I first wanted to use the separator="" parameter but not sure how to complete this...

#1141602

Hi, you won't be able to do this type of customization with the wpv-post-taxonomy shortcode. Instead, create a View of the taxonomy, filtered by term, where the term is set by the current post or set by the current post in the loop . Then you can use the View loop to iterate over each related term and build a custom link URL using the term slug shortcode. Let me know if you have questions about that.

<a href="<em><u>hidden link</u></em>">[wpv-taxonomy-title]</a>

https://toolset.com/documentation/user-guides/views-shortcodes/

#1142354

My issue is resolved. Thank you!

Thank you Christian, that was indeed the solution... easy piecy ... I'm a bit too busy at the moment... I didn't see this easy solution myself. Thanks

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