Tagged: , ,

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

    Hi,

    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

    #138406

    Hey,

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

    Regards,

    Ismael

    #138407

    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:

    and with Firebug:

    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.

    #138408

    Hi,

    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;
    }

    Regards,

    Ismael

    #138409

    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:

    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.

    #138410

    Hi,

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

    Regards,

    Ismael

    #138411

    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.

    #138412

    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.

    Regards,

    Devin

    #138413

    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.