Treehouse: Grow your CSS skills. Land your dream job.

[SOLVED]Having a different css style sheet in the WordPress homepage?

  • # April 27, 2012 at 12:25 pm

    How do you tell WordPress that you want a different css style sheet on the homepage?

    # April 27, 2012 at 12:28 pm

    In the header, add this:

    < ?php
    if (is_home()) {
    echo '';
    # April 27, 2012 at 1:12 pm

    Or, instead of adding a whole new CSS file, you can just target the home page in your style.css with a class that you can put on the body.

    # April 27, 2012 at 4:41 pm

    Expanding on Senff’s code, you might actually be looking for this:

    < ?php
    if (is_front_page()) {
    echo '';
    } else { }
    # April 27, 2012 at 4:43 pm

    That’ll totally remove the default style sheet from the homepage. TheDoc’s solution is probably more preferable though, as it’s unlikely you won’t want to use the styles defined in your main stylesheet, but your case may be an exception.

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

You must be logged in to reply to this topic.