You may wish to create a different look for an individual post or page. This could be as simple as using a different background image called with a CSS class (use the post/page name or ID number as the class definition.
You may want to do something slightly more drastic that involves an entirely new stylesheet. This is very simple to achieve by placing an addition to the metadata in your post in the custom field area of your editing page.
In the key field use a name for your action (in my case ‘custom_style’)
In the value field place the url of your new stylesheet ie http://yourdomain/stylesheets/custom.css
Don’t forget to place your images folder next to your new stylesheet.
Then place the following code in header.php below your existing stylesheet call.
<?php $customcss = get_post_meta($post->ID, 'custom_style', true); ?>
<?php if ($customcss != "") { ?>
<link href="<?php echo $customcss ?>" rel="stylesheet" type="text/css" />
<?php } ?>
Sorted. I’ve done exactly this for this post. In this case all I’ve done is change the background image and colours but you can do anything you like…
2 Comments
Hello.
I love your website especially navigation bar.I try to make a website in WordPress, but I have a problema.How I make that every link from nav-bar to have different image and the current page to look different, like on your website.
Sorry’m not very good at English,briefly I would like to tell me how you did your page navigation bar.
mail me to: mihai.legat@gmail.com
Hi Mihai, the navbar is done using CSS sprites.It’s quite an involved process but I’ll be doing a tutorial at some point. In the meantime there is an article here that may help…
http://www.alistapart.com