• Resolved denorion

    (@denorion)


    I want set specific class to specific tag.
    I have several tags ingredients like – rise, tuna, nori, spicy…
    And i want add specific class to tag spicy to make this tag red.
    Can i make it with tag groups?
    Thx

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you want to color tags by group (“spicy” is the name of a group), you can use the shortcode parameter group_in_class=1 and then use the class names in yur CSS like

    .tg_tag_group_label_spicy {
     background-color:red;
    }

    If “spicy” is the name of a tag, it should be easier (without shortcode parameters):

    .tag-groups-tag .spicy {
     color:red !important;
    }

    You use here the tag slug, which might be different than the tag name.

    Thread Starter denorion

    (@denorion)

    Thx fo reply! I tryed to make this variant, but that’s not what I’m looking for.
    I want highlight only one tag in tag cloud.

    If i have tags on my product page – Ingredients: rise, tuna, nori, spicy souse
    I want make red tag “spicy souse”.

    I can put “spicy souse” in another group – like you write. But i cant output both groups on one line.

    I want something like this – rise, tuna, nori, [RED]spicy souse[/RED], eel, perch

    if use include=”1,3″ – tags output in different blocks. Not in one line

    thx

    Could you post a link to the page? It is much easier to suggest a solution when I can see it.

    What is the slug of your tag “spicy souse”? Maybe “spicy-souse”?

    The 2nd code with the correct slug, for example

    .tag-groups-tag .spicy-souse {
     color:red !important;
    }

    in your CSS does not work?

    Thread Starter denorion

    (@denorion)

    Sorry for my english!) Spicy sauce. it is just a tag fo product page.
    https://srv36546.ht-test.ru/product/%d1%81%d1%83%d1%88%d0%b8-%d1%81%d0%bf%d0%b0%d0%b9%d1%81%d0%b8-%d0%be%d0%ba%d1%83%d0%bd%d1%8c/

    Screen https://prntscr.com/uoe749

    I choose another one way – i make another one tag for spicy products and make badge from this tag. If product have “Hot” tag – it displayed above the image and displayed as a badge.

    I think I will focus on this decision.

    *******
    It would be convenient if you could specify my own css style for each tag in the Tag Groups settings. For example, rice is green, tuna is yellow, spicy red, and so on.

    Thx

    I checked on your website and the problem seems to be that the tag slugs (see on your Tags page in the admin) look in the HTML like “%d1%80%d0%b8%d1%81”. So if it is possible to use only the Latin alphabet for the slugs than the CSS works. For example “соус спайси” can have the slug “spicy-sauce” (or anything else, visitors will not see it) and then you use:

    .spicy-sauce {
     color:red !important;;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can i add css class to specific tag?’ is closed to new replies.