Skip Navigation

[Resolved] .current-cat in custom taxonomy

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Shane 5 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1192121

Hello,
I have created several custom Woocommerce taxonomies to be able to filter products via widgets. I also use a standard "product category" taxonomy.
With my custom Toolset taxonomies I would like to find a way to recreate ".current-cat" behavior of standard WP taxonomies in a widget: based on current taxonomy archive page the current taxonomy item gets extra class ".current-cat".
Example can be seen here - (e.g. hidden link) current standard taxonomy item has red background.
Is it possible to do that with Toolset custom taxonomies?
Thanks in advance,
Tom

#1192134

I have tried experimenting with

<wpv-loop>
	<li class="cat-item [wpv-conditional if="[wpv-taxonomy-slug] eq [wpv-taxonomy-archive info="slug"]"]current-cat[/wpv-conditional]">[wpv-post-body view_template="loop-item-in-widget-rocnik"]</li>
		</wpv-loop>

but not working 🙂

#1192214

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tomas,

This might be a little tricky to achieve but could you try it like this ?

<wpv-loop>
    <li class="cat-item [wpv-conditional if='[wpv-taxonomy-slug] eq [wpv-taxonomy-archive info='slug']']current-cat[/wpv-conditional]">[wpv-post-body view_template="loop-item-in-widget-rocnik"]</li>
        </wpv-loop>

Using the single quotation

Thanks,
Shane

#1192237

Hello, Shane,
unfortunately, this does not work 🙁

#1192247

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tomas,

Would you mind allowing me to have access to your site so that I can check on this for you ?

Also please let me know the page where this issue is one.

Thanks,
Shane

#1192607

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tomas,

Thank you for the credentials.

So the issue here is that the quotations are causing the issue with the mismatch of quotes.

This one doesn't seem to be possible to achieve.

Thanks,
Shane

#1192608

Hello Shane,
ok, got it. Thanks anyway for the effort 🙂
All the best,
Tom

#1192632

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tom,

No problem, marking this as resolved.