Skip Navigation

[Resolved] Link Entry to its Taxonomy Page

This support ticket is created 4 years, 6 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
- 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 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 4 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1664517

Hello,

I have the custom post type "Brides"
And attached to that I have the taxonomy "Locations"
In locations I have a hierarchy:
Latin
Colombia
Brazil
Cuba
etc

I have a row of images that are dynamically pulled from the database of "brides" entries. I would like to have each of those images link back to the location page associated with the image. If the image is in the Colombia taxonomy - it will link to the Colombia page etc.

You can see the current strip at the top of my home page - hidden link
And here is a location page - hidden link

I'm sure there is a very simple solution but it has been a while since I have done any work in Toolset so I have forgotten how to do pretty much everything!

Can you tell me how to do this?

Currently these images are linking to a custom url which is taken from a custom field - here is my current code:

[types field='logo' alt='%%ALT%%' ][/types]

Thanks

#1664669

Hello,

I assume each "Brides" post is assigned with only one term of taxonomy "Locations".

You can use [wpv-post-taxonomy] shortcode to get term's archive URL, for example:
[wpv-post-taxonomy type="locations" format="url"]

Then use above shortcode to setup your HTML link, like this:

<a href='[wpv-post-taxonomy type="locations" format="url"]' target="_blank" rel="noopener nofollow noreferrer">[types field='logo' alt='%%ALT%%' ][/types]</a>

This will not work as expected if one "Brides" post is assigned with multiple terms of taxonomy "Locations".

More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-taxonomy