Skip Navigation

[Resolved] Marking up current taxonomy in view

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

This topic contains 2 replies, has 2 voices.

Last updated by emilyT 6 years, 7 months ago.

Author
Posts
#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: hidden link

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