Style category pages based on category (4 posts)

  1. el terrible bmw
    Posted 4 years ago #

    I want to style category pages different based on which category it is. I'll really only have 2 categories, so I'll need to do like if category = 1, display these divs and attributes, else if category = 2, do this instead. What's the most efficient and correct way of doing this? Thanks. :)

    I found this link, but it's from 2007 and I don't know if that's still the best way.

  2. Michael
    Forum Moderator
    Posted 4 years ago #

    this would be better to answer if you could post a link to your site, or at least name the theme that you are using.

    if you don't want to change the output, and your theme uses body_class() http://codex.wordpress.org/Function_Reference/body_class then you might be able to use the css class output by body_class to add new styles to format the divs.

    in extreme, look into http://codex.wordpress.org/Category_Templates

  3. el terrible bmw
    Posted 4 years ago #

    I'm using the whiteboard framework. Can't post the link because I'm working off my local server. I was thinking about that category-slug.php or ID, just wasn't sure if it was a recommended way over having it all in one file isolated by if statements.

  4. el terrible bmw
    Posted 4 years ago #

    Ok I used category templates, and that's working out perfectly. Thanks for your help alchymyth!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.