[Resolved] Different color per category

Home Forums Support [Resolved] Different color per category

Home Forums Support Different color per category

  • This topic has 5 replies, 2 voices, and was last updated 1 month ago by Elvin.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2049320
    Tri Ryuzaki

    Hi there, how can I define different color for each category on blog archive (as well as on single post page). Thanks

    View post on imgur.com

    https://fiverrguy.com/blog/

    #2049379
    Elvin
    Staff
    Customer Support

    Hi there,

    You can style these links through their href attribute. (category slug)

    Example:

    #main span.cat-links a[href*="affiliate-marketing"] {
        background-color: red;
        color: white;
    }
    
    #main span.cat-links a[href*="on-page-seo"] {
        background-color: blue;
        color: white;
    }

    You create a CSS entry for each category you want to style. ๐Ÿ˜€

    A wise man once said:
    "Have you cleared your cache?"

    #2049389
    Tri Ryuzaki

    Hi Elvin, it works perfectly on the default blog page, thanks. How can I achieve the same effect on the custom blocks / layouts which are created with “Element Blocks”?. For example, the post header is created using Block Element (Page Hero type), and the category is created by using “Headline” block element, how can we achieve the same effect on those custom category text?

    View post on imgur.com

    https://fiverrguy.com/how-to-make-a-graph-in-google-sheets/

    #2049398
    Elvin
    Staff
    Customer Support

    We can modify the format of the code to something like this:

    #main span.cat-links a[href*="affiliate-marketing"],
    .dynamic-term-class a[href*="affiliate-marketing"] {
        background-color: red;
        color: white;
    }
    
    #main span.cat-links a[href*="on-page-seo"],
    .dynamic-term-class a[href*="on-page-seo"] {
        background-color: blue;
        color: white;
    }

    A wise man once said:
    "Have you cleared your cache?"

    #2049410
    Tri Ryuzaki

    Hi, it works great, thank you =)

    #2049413
    Elvin
    Staff
    Customer Support

    No problem. ๐Ÿ˜€

    A wise man once said:
    "Have you cleared your cache?"

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.