If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #28714


    hope that this is not too complicated … I would like to style the category names in the minor-meta line beneath the post title in that way, that each of my 4 categories get another color – but only in this line, this category name/link should get another color.

    Means, that if there’s the category name “AAA”, then this linked category name should be for example #FF0000;

    or if the category name there is “BBB”, then this linked category name should be ##04FF00; etc.

    I’ve tried it with something like that, without any effect:

    #top .category-36 .post-meta-infos a {
    color: #ff0000 !important;

    I have googled a lot and searched for plugins to do this or a tutorial, but I haven’t found anything.

    Can anybody help me out please with some code or with a tutorial source or plugin, where I can search for more infos?

    Thanks a lot, appreciate



    You can use the nth-child css selectors: http://css-tricks.com/how-nth-child-works/




    Thanks a lot, but your link describes something about lists and the minor-meta category names are as I see it, no lists?

    I’ve tried with a lot of try and error with my low CSS knowledge this:

    .category-36 .post-meta-infos a[rel] {
    color: #ff0000 !important;

    This code shows the category name in a single post (!!!) NOT COLOURED, but at a category archive page, which contains posts of this category, it is right coloured:

    (Purchase code hidden if logged out) /28119c5b60595acbe2348aa10f5cf067/res/ (Purchase code hidden if logged out) /skitch.png?resizeSmall&width=832″ />

    and with Firebug:

    (Purchase code hidden if logged out) /a38f524322aa66dfd8404cb5d5e8b294/res/ (Purchase code hidden if logged out) /z2.jpg?resizeSmall&width=832″ />

    But when I view only this single post, it is no more coloured.

    Another error: if I’m on the category archive page of cat-36 for example, and the post is set to cat 36 and cat37, too, then both category names are coloured (in posts on the category archive page of cat36).

    In a single post the category name of one of my 3 top cats should each get there another colour.



    I’m not sure if this is what you want but if you use the nth child selector. You’ll have this effect:

    This is the code for the image above:

    .blog-categories.minor-meta a:nth-child(1) {
    color: red;

    .blog-categories.minor-meta a:nth-child(2) {
    color: blue;

    .blog-categories.minor-meta a:nth-child(3) {
    color: green;




    Thanks a lot, I have used your CSS, on a single post view, I have now these 3 coloured for 3 categories, but on the blog overview page it looks now like this – although there are 3 different categories, they all are red:

    (Purchase code hidden if logged out) /947ffa5388933ea5e0f746adda10479f/res/ (Purchase code hidden if logged out) /skitch.png?resizeSmall&width=832″ />

    Each category should have its own colour – no matter if it’s the blog overview page with several posts on it from various categories, or if it’s a category’s archive page or if it’s a single post.

    The name of category A should, for example, always appear red, the name of category B always blue, and the name of category C should always appear green – no matter on what view/page/post.



    The screenshot I posted above is the Blog Overview page. The category color looks the same on the single post view.




    My screenshot has gone lost – here it is again and shows, why this does not work properly:

    Different categories have the same color at the blog overview page. But each cat should have its own colour – no matter where.


    Hi colorit2,

    Unfortunately that really isn’t doable as far as I know. You would need some kind of customization on the WordPress tags to always wrap them in their own custom class name.




    okay, thanks, Devin.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Styling the category tags within the line under the post's title (minor-meta)’ is closed to new replies.