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
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