Skip Navigation

[Résolu] Marking up current taxonomy in view

This support ticket is created Il y a 6 années et 6 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Marqué : ,

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par emilyT Il y a 6 années et 6 mois.

Auteur
Publications
#891892

Hi folks

I've got a list of taxonomy terms that I've created using a view. When this displays on the taxonomy archive page I would like the current taxonomy to be indicated.

For example, this is the page for the monumental category: lien caché

The Filter list across the top is inserted using a view, with the following loop:
<wpv-loop>

  • [wpv-taxonomy-link]
  • </wpv-loop>

    Is there a way of adding a class which appears if you're on the archive for the current term? So, for my example I would like Monumental to have class="current".

    Many thanks, Emily

    #892221

    It's not possible natively but several users have achieved this goal with a custom code.

    More details can be found here:
    https://toolset.com/forums/topic/setting-a-specific-style-for-the-active-taxonomy/
    https://toolset.com/forums/topic/how-to-conditionally-change-appearance-of-taxomony-title-in-list/

    I think these 2 tickets should help you to achieve the goal as well

    It requires custom code which usually does not fall under our Support, but if you struggle with its implementation we can eventually help.

    #895221

    Hi Beda

    Thanks for your suggestions. I had a go with the suggestions in those two forum posts but couldn't get either to work I'm afraid.

    Actually, the solution in this case was to use the Category widget - as this was for the posts categories rather than a custom taxonomy that did the trick.

    Thanks again for your help.
    Cheers, Emily