Hey, I want to implement and external style sheet for just one page of my wordpress site. I am running wordpress 3. Is there any easy way to do this? I found a plugin, but it doesn't seem to be compatible with WordPress 3...
Hey, I want to implement and external style sheet for just one page of my wordpress site. I am running wordpress 3. Is there any easy way to do this? I found a plugin, but it doesn't seem to be compatible with WordPress 3...
http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page
You could use the is_page() function to add the stylesheet link to that particular page.
1. If anyone knows a cleaner way, I would apreciate it.
2. I'm not very good at php, so could someone give me an example of what using this properly might look like. I am trying to load an external stylesheet or create page wide style rules. Normally both of these have to be in the "<head>" section of a webpage I think.
In your header.php file, within the <head> tag and after all the other stylesheet links, add:
<?php
if(is_page('Page-Name')){
echo '<link href="path/to/stylesheet.css" rel="stylesheet" type="text/css" />';
}
?>Okay, so that works for now, but might get a little unorderly with a lot of pages. Is there a cleaner solution. If not, thanks so much TFS for your time!
This topic has been closed to new replies.