Title: Variable sidebar content
Last modified: August 19, 2016

---

# Variable sidebar content

 *  [shaun1981](https://wordpress.org/support/users/shaun1981/)
 * (@shaun1981)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/variable-sidebar-content-1/)
 * I have read the documentation on conditional tags and understand how to use them
   however with my sidbars being dynamic or with widgets i’m not sure where my conditional
   info needs to go.
 * This is my current sidebar code:
 *     ```
       <div id="sidebar">
       <div class="side1">
       <ul>
       <?php jh_ShowAbout(); ?>
         <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
         <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
       	  <li class="blockr">
               <h2>Archives</h2>
               <ul>
                 <?php wp_get_archives('type=monthly'); ?>
               </ul>
             </li>
             <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>
         <?php endif; // end 1 Dynamic Sidebar  ?>
       </li>
       </div>
       </div>
       </div> <!-- end left -->
       <div id="right">
         <div class="side2">
           <ul>
       	  <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
       	  	<li class="blockr"><h2>Search This Site</h2>
       				<?php include (TEMPLATEPATH . '/searchform.php'); ?>
       		</li>
             <?php /* If this is the frontpage */ if (is_home()) { ?>
             <?php wp_list_bookmarks(); ?>
             <?php } ?>
       	  <li class="blockr">
       	   <h2>Meta</h2>
               <ul>
                 <?php wp_register(); ?>
                 <li>
                   <?php wp_loginout(); ?>
                 </li>
                 <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr 
   
       title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
                 <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
       		  <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal
       publishing platform.">WordPress</a></li>
                 <?php wp_meta(); ?>
               </ul>
       		</li>
             <?php endif; // end 1 Dynamic Sidebar  ?>
       		</ul>
         </div>
       </div>
       ```
   
 * Can someone tell me how i can change so that it displays a different sidebar 
   for a specific page. i.e. if (is_page(2))
 * In the <div class=”side2″> is where i need to vary the content
 * Thanks

The topic ‘Variable sidebar content’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [shaun1981](https://wordpress.org/support/users/shaun1981/)
 * Last activity: [17 years, 12 months ago](https://wordpress.org/support/topic/variable-sidebar-content-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
