How can I specify a CSS class to a blog title? (3 posts)

  1. HardinComp
    Posted 11 years ago #

    There are some posts I want to specify a specific CSS tag to in order to have a visual match to the topic I cover in the post. I tried it today, but it just mucked things up.

    Basically I want to be able to specify the class "Tulane" for posts I write about the Tulane baseball team at the College World Series. The CSS for that class is:

    .Tulane {
    color: #006633;
    font-weight: bold;

    Is there a way to do this or am I trying to do the impossible?

  2. ifelse
    Posted 11 years ago #

    You could try something like this:
    <h2 class="if ( in_category('category_id') ){
    echo "Tulane";
    } ?>">

  3. HardinComp
    Posted 11 years ago #

    I'll have to try that, although it could get unwieldy if I want to do specific classes for multiple categories. Thanks for the suggestion.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.