Here’s how to include different sidebars for particular pages:
<?php
if(is_page()) {
// We're on a "page", which?
if (is_page('About')) {
// Ah, the about page!
get_sidebar('about'); // includes sidebar-about.php
} elseif (is_page('archives')) {
get_sidebar('archives'); // includes sidebar-archives.php
} elseif (is_page('contact')) {
get_sidebar('contact'); // includes sidebar-contact.php
} else {
// if we're not any of the above pages
get_sidebar(); // includes regular sidebar.php
} else {
get_sidebar(); // includes regular sidebar.php
}
?>
If you want to extend it further, such as displaying different sidebars for different categories, use this code:
< ?php
if(is_page()) {
// We're on a "page", which?
if (is_page('About')) {
// Ah, the about page!
get_sidebar('about'); // includes sidebar-about.php
} elseif (is_page('archives')) {
get_sidebar('archives'); // includes sidebar-archives.php
} elseif (is_page('contact')) {
get_sidebar('contact'); // includes sidebar-contact.php
} else {
// if we're not any of the above pages
get_sidebar(); // includes regular sidebar.php
} else {
get_sidebar(); // includes regular sidebar.php
}
?>
Related posts:

Web professional in Malta, Europe. Focusing on building visually stunning websites that are easy to maintain, usually using WordPress as the CMS. Web developing since 1995, loving WordPress for more than 5 years.
Or for a code-less approach you could install my Graceful Sidebar Plugin. This plugin enables you to create custom sidebar content for each page or post using custom fields.
Enjoy!
Thanks Mike, nice solution