Support » Fixing WordPress » Color code specific category's article

  • Hi,

    I want to highlight articles of a specific category and its subcategories. How can i change the background color of the articles in the blog list?


Viewing 1 replies (of 1 total)
  • If your theme makes use of the body class and post classes, and most do, you can use css

    First, do a view source of your site to look at your source code to make sure its good

    You just click view in your browser and go to source/source code…

    look for something like:

    <body class="home blog paged logged-in admin-bar paged-2 single-author two-column right-sidebar">


    <article id="post-681" class="post-681 post type-post status-publish format-standard hentry category-filters tag-add_action tag-filter tag-pre_get_posts">

    That’s off my index page for a certain post…. you can see all sorts of options in there,

    The body class lets you target the proper page, and the article (or it might be post) class lets you target posts based on certain criteria

    So I pick home from the body class and category-filters from the article class

    And I can target and posts on the blog listing in the filters category

    So in style.css if I put:

    .home .category-filters {
         color: #fff;
         background: #401f1f;

Viewing 1 replies (of 1 total)
  • The topic ‘Color code specific category's article’ is closed to new replies.