• Hello,

    i am trying to do something and i haven’t find any plugin for it.
    I have my blog-list page and there is a color on each post preview (the background color under the post date).
    I want this color to change according to the category of each post.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    How will you manage the colours?

    Thread Starter NikosZ

    (@nikosz)

    I will use custom css
    By the following i change all the post colors in the blog list. How can i take into account the post category or if its easier the post id (ex .postid-1205)

    .blog-list .date-box .day {
    background-color: #fff;
    }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Look at the class on the <body> element (view source). Say if it’s ‘category-foo’, you’d usually just prepend that to your selectors:

    
    .category-foo .date-box .day {
        background: #fff;
    }
    
    Thread Starter NikosZ

    (@nikosz)

    Thanks for the tip. It worked for the category-page but it doesn’t affect the main blog-list page. It seems that in the main blog-list page there isn’t any info about each post’s category. I am afraid what i am looking for is not very simple. Any other idea?

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Blog list differents post colors’ is closed to new replies.