Grow your CSS skills. Land your dream job.

Hey Chris, how did you…

  • # June 4, 2008 at 7:36 am

    I have learned a lot from this site since I discovered it a couple weeks ago, and actually re-designed my band web page (in beta form right now at http://testingground.fropac.com/wordpress) by following along with your PSD to CSS screencasts and tweaking some things along the way. One thing that’s really stumped me though is, how did you get css-tricks to work so that the "ARTICLES" tab is in the "on" state when you get here? I used the following code in header.php to get the other tabs to work in the "on" state:

    Code:
    # June 4, 2008 at 7:47 am

    Actually, I hacked a solution using the All in One SEO Pack plugin. Works great now!

    # June 4, 2008 at 8:46 am

    works great but fails validation…

    # June 4, 2008 at 9:23 am

    Like you’ve figured out, I use an ID on the body to "activate" the tabs. I don’t use anything dynamic in those ID names, in the header.php file in my WordPress theme, my body ID is set to "blog" which makes that tag active on all articles pages. These other pages are not WordPress powered, so in those files I set the ID to something else.

    # June 4, 2008 at 5:24 pm

    that makes sense. Thanks Chris, and keep up the awesome work!

    # June 4, 2008 at 8:43 pm

    Here’s an update for anybody that reads this who ran into the problem I did and wants to keep all their pages in WordPress. I managed to get it to validate and work properly at the slight expense of my SEO-friendly permalinks. If you leave your WordPress permalink structure on "default," the following code will help differentiate the pages for your tabs to work properly:

    Code:
    < ?php if(!isset($_GET['page_id'])) { ?>

    < ?php } else { ?>
    Code:
    < ?php if(!isset($_GET['page_id']) {
    echo '‘;
    } else {
    echo ‘‘;
    }
    ?>

    ends up giving me the "home" body tag right, but shows the other tags as (for example) bio<body id="">.

    I’d imagine you could expand on it and do something using if/else statements to use it with the SEO-optimized permalinks, but until I decide to not be lazy anymore and actually work on it, this is going to have to do.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".