Different CSS for Homepage

Community Forums Forums Design Tips and Tricks Different CSS for Homepage

This topic is: not resolved

Tagged: , ,

This topic contains 6 replies, has 2 voices, and was last updated by  braddalton 1 year, 2 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #66354

    Aryadne
    Participant
    Post count: 12

    How can I apply a different CSS stylesheet to the homepage in the Balance Theme?

    #66363

    braddalton
    Participant
    Post count: 10675
    #66546

    Aryadne
    Participant
    Post count: 12

    Thanks for the reply. I assume this code would go in the functions.php file? I saw a previous answer on wordpress.org to place this in the header.php file. But with Genesis I didn’t see a place to put this.

    And should I use: if ( is_home() ) or if ( is_frontpage() )?

    #66577

    braddalton
    Participant
    Post count: 10675

    Very good questions.

    1. Always best practice to use your child themes functions.php file because this isn’t over-written when your parent theme is updated which in this case is Genesis.

    WordPress.org contains a lot of parent theme template code modifications which are lost when you update your parent theme and not really focused on designers wanting to modify existing code.

    2. (i) is_home() returns true for the posts page which is determined in your Reading Settings and may not be the front page if you use a static page with the blog page template.

    (ii) is_front_page() always returns true for the front page of your site regardless of your Reading Settings.

    So you can clearly see that your posts page (blog page) isn’t always your front page and therefore requires the use of the correct conditional tag.

    Note the path to the 2nd CSS file requires you to create a new folder in your child theme named CSS.


    #66694

    Aryadne
    Participant
    Post count: 12

    Thanks so much. I’ll give this a try and let you know if it works.

    #66724

    Aryadne
    Participant
    Post count: 12

    Still having an issue. I put the code at the end of the functions.php file and uploaded both the second-style.css file and the functions.php file but I’m not seeing an changes on the homepage.

    I didn’t make any changes to your code.

    #66757

    braddalton
    Participant
    Post count: 10675

    Works now. Just updated the code and tested it.


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

You must be logged in to reply to this topic.