WordPress.org

Ready to get started?Download WordPress

Forums

CSS for element in particular category on the main page (2 posts)

  1. fodden
    Member
    Posted 2 years ago #

    I'm trying to target an element within an entry on the main page such that, for example, the h2 title of all category-blue entries is blue and the rest, i.e. those in other categories, are "normal." I've inserted <?php post_class() ?> into the target element, and I've got a line in the CSS to control the class category-blue (e.g.)—but I'm getting no joy. The source code shows that my element contains the class category-blue, which makes the result puzzling. (If I hard code a class into the element, as a test, I have no trouble controlling the formatting with CSS.)

    Does the <?php post_class() ?> template somehow not work on the main page? on an element within an entry?

  2. vtxyzzy
    Member
    Posted 2 years ago #

    If you post a link to your site where the problem can be seen, someone might be able to help.

Topic Closed

This topic has been closed to new replies.

About this Topic