I have already looked in some forum posts, but can´t find the solution for this:
I have a taxonomy view with this code in the top of a WordPress archive where I want to add a * on the active taxonomy:
<wpv-loop>
| [wpv-taxonomy-link][wpv-conditional if="( '[wpv-taxonomy-archive]' eq '[wpv-taxonomy-title]' )"]*[/wpv-conditional]
</wpv-loop>
But it's not working properly. Have a look at hidden link
sometimes it works, others not.
Can you help me?
The link shared is a Post Archive.
There cannot be any Taxonomy Active on this link.
Then, if you click on one of the 6 taxonomies you render with the View, you are lead to the Archive of the taxonomy, which for example is this:
hidden link
Hence, I assume this is where you want the "active" term to be somehow highlighted.
And in fact it is, if you look at the "Contos" you see the asterisk
I think you already solved the issue?
You are right, I do not explain it correctly. Please try to click in the other taxonomies. The asterisk stays in the same taxonomy instead of the active taxonomy.
You are right.
The ShortCode "wpv-taxonomy-archive" supports attributes so to output only certain info about the taxonomy:
'name'
'slug'
'description'
'id'
'taxonomy'
'parent'
'count'
That ShortCode thou is not available in a Taxonomy View, and you probably copied the ShortCode over from another (post or archive) View.
You cannot achieve this with Toolset easily, it is more of something managed by Themes (just as breadcrumbs).
I apologize that I did not notice this at the first approach.
So... with toolset there is no way to have a taxonomy menu where the active taxonomy could be highlighted in any form?
I use a checkbox on other site and it works fine. But on this site, I want to use link texts or buttons.
Not within the GUI.
You might craft a ShortCode that gets the current URL's last string and compare that with the Taxonomy Slug, using HTML conditional.
You would get the current URL, strpos() the last / and take the string after that as the comparison value.
https://stackoverflow.com/questions/1361741/get-characters-after-last-in-url/1361752
You would have to register this ShortCode in Toolset > Settings > Custom Content > 3rd Party ShortCodes
Please let me know if you need further informations in regard.