I have created a custom page-front.tpl.php file and a custom page-front.css file to go with it. Everything is working fine on my front page. Unfortunately, the page-front.css file is affecting the rest of my site as well. I am using a Zen Sub-theme. If the answer is to change something in the template.php file, please be very specific as I am not well versed in PHP and have already tried a couple of fixes that I found online but was not able to get to work.

Thank you in advance to anyone who can help me out with this problem!!!!

Comments

konordo’s picture

How are you including the page-front.css? Are you using the .info file to do that? If yes, your css would be available in all pages of your site.

One suggestion is to include the css like this.

Edit the page-front.tpl.php and add the following code:

<head>
    ...
    <?php print $scripts; ?>
    <?php global $base_url; ?>
    <link type="text/css" rel="stylesheet" media="all" href="path/to/css/page-front.css" /> 
</head>

Remember to clear cache after your changes.

--------------------------------------------
Konordo Ltd
http://www.konordo.com

Anonymous’s picture

You have no idea how happy you have just made me! This works perfectly! Thank you for making it so clear what to put and where to put it…I had tried several different things in several different spots, but just couldn't quite get it right. Thank you! Thank you! Thank you!