Title: Adding Sidebars
Last modified: August 21, 2016

---

# Adding Sidebars

 *  [SF_CENTER](https://wordpress.org/support/users/sf_center/)
 * (@sf_center)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/adding-sidebars-2/)
 * Hi There:
 * Hoping somebody might be able to help troubleshoot adding sidebars to my site.
   Using the Themetrust Hardy theme.
 * [http://74.205.124.17/~centerrocks/?page_id=972](http://74.205.124.17/~centerrocks/?page_id=972)
 * I’d like to be able to customize a sidebar for each navbar category, i.e. “ABOUT”
   and “AWARDS & GRANTS” and so on.
 * I started with “ABOUT,” adding a new php page template called “page-about.php.”
 *     ```
       <?php
       /*
       Template Name: About
       */
       ?>
   
       <?php get_header(); ?>	
   
       		<?php if(!is_front_page()):?>
       		<div id="pageHead">
       			<div class="inside">
       			<h1><?php the_title(); ?></h1>
       			<?php $page_description = get_post_meta($post->ID, "_ttrust_page_description", true); ?>
       			<?php if ($page_description) : ?>
       				<p><?php echo $page_description; ?></p>
       			<?php endif; ?>
       			</div>
       		</div>
       		<?php endif; ?>
       		<div class="wrap">
       		<div class="middle clearfix">
       		<div id="content" class="twoThirds clearfix">
       			<?php while (have_posts()) : the_post(); ?>
       			    <div <?php post_class('clearfix'); ?>>
       					<?php the_content(); ?>
       				</div>
       				<?php comments_template('', true); ?>
       			<?php endwhile; ?>
       		</div>
   
       		<?php get_sidebar('sidebar_2'); ?>
       		</div>
       		</div>
   
       <?php get_footer(); ?>
       ```
   
 * Then I duplicated the sidebar template, calling it “sidebar_2.php.”
 *     ```
       <div id="sidebar_2" class="clearfix">
   
       	<?php if(is_author()) : ?>
       		<div class="widgetBox sidebarBox clearfix">
       			<h3><?php _e('Author Info', 'themetrust'); ?></h3>
       			<?php global $wp_query; $current_author = $wp_query->get_queried_object(); ?>
       	    	<?php echo get_avatar( $current_author->user_email, '80' ); ?>
       	    	<p><?php echo $current_author->description; ?></p>
       	    </div>
       	<?php endif; ?>
   
           <?php
       	    if(is_archive() && is_active_sidebar('sidebar_posts')) : dynamic_sidebar('sidebar_posts');
       		elseif(is_home() && is_active_sidebar('sidebar_posts')) : dynamic_sidebar('sidebar_posts');
       	    elseif(is_single() && is_active_sidebar('sidebar_posts')) : dynamic_sidebar('sidebar_posts');
       	    elseif(is_page() && is_active_sidebar('sidebar_pages')) : dynamic_sidebar('sidebar_pages');
       		elseif(is_search() && is_active_sidebar('sidebar_posts')) : dynamic_sidebar('sidebar_pages');
       		elseif(is_front_page() && is_active_sidebar('sidebar_home')) : dynamic_sidebar('sidebar_home');
       	else : ?>
   
       		<?php if (!dynamic_sidebar('sidebar_2')) ;?>  		
   
       	<?php endif; ?>
       </div><!-- end sidebar -->
       ```
   
 * These were each modified based on my theme’s files.
 * On the back end, I’ve been able to nest pages under the About template. And in
   the widgets menu, I see the Sidebar 2 and I can drag and drop widgets beneath
   it. However, those widgets do not appear on the page after reloading.
 * Anyone have any tips? Thanks so much for your time.

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/adding-sidebars-2/#post-4380381)
 * > Then I duplicated the sidebar template, calling it “sidebar_2.php.”
 * review:
    [http://codex.wordpress.org/Function_Reference/get_sidebar](http://codex.wordpress.org/Function_Reference/get_sidebar)
 * your code `<?php get_sidebar('sidebar_2'); ?>` for example would call a **_sidebar-
   sidebar\_2.php_** file.

Viewing 1 replies (of 1 total)

The topic ‘Adding Sidebars’ is closed to new replies.

## Tags

 * [get sidebar](https://wordpress.org/support/topic-tag/get-sidebar/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/adding-sidebars-2/#post-4380381)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
