On the WordPress support list, a member wrote in to say he had been creating sidebars for different pages within his website. Within the file archive.php he was able to call a NEW sidebar for each new post that came in. But then he wanted to have a few PAGES and for each PAGE to have another sidebar of its own. His solution was to use the following code snippet within the file archive.php: (Note: the new sidebar was called sidebarabs)
get_sidebarabs();
This post invited a comment that the proposed solution is rather roundabout, and provided an alternate, easier method:
* STEP 1. Create a file called functions.php and put it into your theme directory
* STEP 2. Inside that functions.php file, put:
function get_sidebar_news() {
do_action( 'sidebar_news' );
if ( file_exists( TEMPLATEPATH . '/sidebarnews.php') )
load_template( TEMPLATEPATH . '/sidebarnews.php');
else
load_template( ABSPATH . 'wp-content/themes/default/header.php'); }
* STEP 3. Create a filed called sidebarnews.php and put whatever you want in it
* STEP 4. In whatever page/section you want to use this new sidebar, call it via `
* STEP 5. You can create as many sidebar functions as you want doing the same method




