Using a different CSS stylesheet in WordPress
Last year I did a very simple site on WordPress for Designer Waxing Glasgow, a new business which started by specialising in cosmetic and intimate waxing for ladies. Naturally, we were able to go over the top with a very girly pink visual design.
This year Jennifer expanded her business to include the increasingly popular service of male waxing. She wanted the male bits (heh) to go on the site, but obviously we could not use girly pink to sell male waxing. The new pages had to have the same layout but a different CSS-based design.
The solution was to add the following code to header.php:
<?php if ( is_page(array('male-waxing','male-waxing-faqs')) ) { ?>
<link rel="stylesheet" href="/wp-content/themes/designer-waxing/manstyle.css" type="text/css" media="screen" />
<?php } else { ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<?php } ?>
with the different pages noted in the array and the URL of the different stylesheet following. You can see the results on her Male Waxing page (NSFW or uppity Americans.)




nice touch!
Cat
11 June 2009 at 4:22 pm
Thank you so much! This helped me a lot!
Kevin
17 June 2009 at 10:33 am
Thanks so much…..that will help a lot.
Now if I can just have someone do a css that will allow for 3 column background….with differnt colors for the left and ride sidebar areas my life will be complete!
Lorian Rivers
21 October 2009 at 12:40 am