Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

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

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #37814
    djrolstad
    Participant

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

    #101888
    Senff
    Participant

    In the header, add this:

    
    if (is_home()) {
    echo '';
    }
    ?>
    #101896
    TheDoc
    Member

    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.

    >
    #101907
    clicknathan
    Member

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

    
    if (is_front_page()) {
    echo '';
    } else { }
    ?>
    #101908
    clicknathan
    Member

    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)
  • The forum ‘CSS’ is closed to new topics and replies.