• Hi everyone!

    I need a bit of coding help, each advice will be greatly appreaciated.

    Right now I’m costumizing a theme for my purposes and I’m using a masonry grid to display recent posts. Each thumbnail has a category link in its upper right corner. In the css file, the category link is set to a default color but I really want each category to have its own font color.

    Is it possible to do that effect with css?

    You can see the webpage here.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • if each post has only one category, you might be able to base the formatting on the category dependent CSS class output by post_class();
    https://codex.www.ads-software.com/Function_Reference/post_class

    examples:

    body.wpshower-masonry .category-design .entry-meta-top .categories-links a { color: red; }
    body.wpshower-masonry .category-umeni .entry-meta-top .categories-links a { color: orange; }

    with posts having more than one category, the result would get unreliable…

    Thread Starter jon_xo

    (@jon_xo)

    Hi!

    Thank you very much, this is how I did it. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different color for each category link?’ is closed to new replies.