• Hello,

    I added to every category name a background-color with the classes .category-slug and a specific class to the name. I am using Astra and Elementor.
    Everything works fine on the home page but on the post and category pages the .category-slug are changed to the category-slug we are on or to the category that the post is assigned to. But that doesn’t happens to every post, as example here everything is working fine .

    And I don’t have any ideea why the classes are changing.
    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • I see several classes on the post you linked to:

    • .category-discounts
    • .category-anothercat
    • .category-jackiscool
    • .category-sponsored
    • .category-student-life

    As you wrote, everything is working fine there. Can you link to a post where things aren’t working as expected?

    Thread Starter Florian

    (@webyouup)

    The class isn’t changed, I expressed myself wrong, is overruled. As you can see here: /what-is-lorem-ipsum/ the color of the category is the jackiscool category, that light blue. It changes the color for discount and anothercat. I can’t add important to every each class because nothing changes. I need each class to display the background color I assigned.

    On this post everything is working fine /get-50-off-the-latest-voxi-sim-by-vodafone

    The “Lorem Ipsum” post has the same categories as the “Where Can I Get Some?” post (which I listed before — apologies if I misread your message) and the “Vodafone” post — all three match.

    It sounds like you’re applying unique CSS to each category, but when you apply multiple categories to each post, those CSS rules conflict, and you don’t get the one you want. Is that correct?

    If so, then you may want to find another way to target your CSS, or use fewer categories — or add another, unique category that is just for CSS.

    Thread Starter Florian

    (@webyouup)

    That is the thing, each post has one different category. Each color is one category for each post.

    • This reply was modified 6 years, 6 months ago by Florian.
    • This reply was modified 6 years, 6 months ago by Florian.
    Thread Starter Florian

    (@webyouup)

    I checked these three category archives:

    /category/sponsored/
    /category/jackiscool/
    /category/student-life/

    The “Voda Phone” and “Lorem Ipsum” posts show up on each one. That shouldn’t be the case if each post had only one category. 🤔

    Thread Starter Florian

    (@webyouup)

    That is the same section as in the post page at the end. Didn’t add yet the display of that category because it has only one post and I don’t know yet how the client wants to look like.

    It is supposed to look like this:
    /category/memes/

    • This reply was modified 6 years, 6 months ago by Florian.
    • This reply was modified 6 years, 6 months ago by Florian.
    • This reply was modified 6 years, 6 months ago by Florian.
    Thread Starter Florian

    (@webyouup)

    In case you missed it… Section:

    How it should display
    https://everythingstudent.co.uk/category/discounts/

    How it displays on other category
    https://everythingstudent.co.uk/category/sponsored/

    I can’t figure out why it isn’t respecting the css everywhere.

    • This reply was modified 6 years, 6 months ago by Florian.
Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Issue with .category-slug’ is closed to new replies.