How can I apply a different CSS stylesheet to the homepage in the Balance Theme?
You can do this conditionally. http://wpsites.net/wordpress-themes/second-style-sheet-theme/#Custom_Home_Page_Style_Sheet
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() )?
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.
Thanks so much. I'll give this a try and let you know if it works.
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.
You must be logged in to reply to this topic.
Subscribe to get early access to new themes, discounts and brief updates about what's new with StudioPress!