• My wife’s blog (https://www.popularstranger.com) has different categories, and she’s used MS paint to draw up different backgrounds for each of her categories (links, paint-ings, photos) that I’ve setup as different stylesheets. I’m thinking a php if statement at the beginning of the index.php to choose the stylesheet using $cat would work, but I’m new to php. How do I code in php
    If category = links, then links.css; if category = paint-ings, paint-ings.css, if cat=photos then photos.css, and for everything else this.css?
    thanks for the help. I think most communities would be annoyed with all the refugees but the WP community has risen to the occassion. kudos.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter superultra

    (@superultra)

    Figured it out. =)

    I like the design and how the posts are setup. Very unique…I’ve never seen something like that anywhere else! Just goes to show the power of WP. ??

    It’s great you figured it out.
    mind sharing it with us?
    dss

    Funky :0)

    Note that you can do this with a single CSS file, and one change to the index.php… at least for category pages.
    Change
    <div id="rap">
    into
    `<div id=”rap<?php echo $cat?”-$cat”:””; ?>”>
    That will make styles #rap for non-cat pages, and #rap-1, #rap-2, etc., for category pages. You can also get the catname for the numbered cat and use that instead in the echo.
    I use quick tricks like this for modifying per-post stylings.
    -d
    https://www.chait.net

    l

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Different CSS for each category page?’ is closed to new replies.