Skip Navigation

[Resolved] Taxonomy filter, every selection his own class

This thread is resolved. Here is a description of the problem and solution.

Problem:

The user wanted to add a class to their filters.

Solution:

This can be done by just adding the Class attribute to the shortcode and then specifying your class name.

Example
[wpv-control-post-taxonomy taxonomy="workshopcategorien" type="radios" default_label="Alle lijnen" url_param="wpv-workshopcategorien" output="legacy" class="cats" label_class="catslos"]

Where you see the class "cats" was added.

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

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 9 replies, has 2 voices.

Last updated by robertv-3 6 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1125444

I created a filter with [wpv-control-post-taxonomy taxonomy="workshopcategorien" type="radios" default_label="Alle lijnen" url_param="wpv-workshopcategorien" output="legacy" class="cats" label_class="catslos"]

In the front it looks like:
hidden link
Pass: New
Starts with "Alle lijnen" in red, I want all the taxonomies to have there own backgroundcolour.
And also the outcome like the title "Van Inactief naar In actie!" i want to give them a different colour depending on there taxonomie.

Is that possible?

#1125556

Shane
Supporter

Languages: English (English )

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

Hi Robert,

Thank you for contacting our support forum.
You should be able to do this by following the example below using the nth-child css selector.
hidden link
Please let me know if this helps.
Thanks,
Shane

#1125897

I think that your answer will work in the first question, to give every taxonomie his own colour.

But not on the second, because there I don't know what the order will be, that depends on what people are clicking/selecting?!

#1126331

Shane
Supporter

Languages: English (English )

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

Hi Robert,

For your second question, i'm not sure I understand this fully. The solution I provided was to change each individual color.

Thanks,
Shane

#1126378

Yes I used the code you send me, see:
hidden link
Pass: New

That worked on the left site all the buttons have there own colour.

Now I want to change the titles, like"Van Inactief naar In actie!", of the articles in the same colour.
I need a automatic class per taxonomy, to colour the titles.
I tried this <div class="tg-nam cat-[wpv-taxonomy-slug]" > but it doesn't work.

#1126428

Shane
Supporter

Languages: English (English )

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

Hi Robert,

I see what you mean no.

This would require some javascript to recognize the selected item and to get the class of that selected item and apply it to the container.

Unfortunately this is something that would be out of the scope of our support forum, so I wouldn't be able to help with this.

Thanks,
Shane

#1126437

Thanks Shane,

That's to bad, but I understand it.
Thanks for your help.

Robert

#1126443

I solved it by using this:
<div class="tg-nam cat-[wpv-post-taxonomy type="workshopcategorien" format="slug"]" >

#1126490

Shane
Supporter

Languages: English (English )

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

Hi Robert,

Awesome. All issue has been resolved now correct?

If so then you can proceed to marking this one as resolved.

Thanks,
Shane

#1126823

My issue is resolved now. Thank you!