Title: Sidebar &#8211; adding sections
Last modified: August 19, 2016

---

# Sidebar – adding sections

 *  Resolved [bogiesbl](https://wordpress.org/support/users/bogiesbl/)
 * (@bogiesbl)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/sidebar-adding-sections/)
 * Hello – HELP – I am trying to add a Contact, Links, and Blog section to my sidebar.
   But, I am lost. I’ve gone in and also added these three to my link categories…
   but that only appears on the main page – not of the Pages pages. Thus I am trying
   to add these three section to the sidebar – but I am not having much luck – go
   to bogiesblog.com and see what I mean. Your help will be soooo welcomed. Thanks!
   
   Here is the code for my sidebar: <div id=”sidebar”>
    - <?php /* If this is a 404 page */ if (is_404()) { ?>
    -  <?php /* If this is a category archive */ } elseif (is_category()) { ?>
    - <p>You are currently browsing the archives for the _<?php single\_cat\_title(”);?
      >_ category.</p>
    - <p><?php next_post_link(‘« previous’) ?> <?php previous_post_link(‘next »’)?
      ></p>
    -  <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    -  weblog archives
    -  for the day <?php the_time(‘l, F jS, Y’); ?>.</p>
    -  <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    -  weblog archives
    -  for <?php the_time(‘F, Y’); ?>.</p>
    -  <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    -  weblog archives
    -  for the year <?php the_time(‘Y’); ?>.</p>
    -  <?php /* If this is the search page */ } elseif (is_search()) { ?>
    -  weblog archives
    -  for **‘<?php echo wp_specialchars($s); ?>’**. If you are unable to find anything
      in these search results, you can try one of these links.</p>
    - <?php /* If this is a single archive */ } elseif (is_single()) { ?>
    -  <p>You can follow any responses to this entry through the <?php comments_rss_link(‘
      RSS 2.0’); ?> feed.
    -  <?php if ((‘open’ == $post-> comment_status) && (‘open’ == $post->ping_status)){
    -  // Both Comments and Pings are open ?>
    -  You can [leave a response](https://wordpress.org/support/topic/sidebar-adding-sections/?output_format=md#respond)
      from your own site.
    -  <?php } elseif (!(‘open’ == $post-> comment_status) && (‘open’ == $post->
      ping_status)) {
    -  // Only Pings are Open ?>
    -  from your own site.
    -  <?php } elseif ((‘open’ == $post-> comment_status) && !(‘open’ == $post->
      ping_status)) {
    -  // Comments are open, Pings are not ?>
    -  You can skip to the end and leave a response. Pinging is currently not allowed.
    -  <?php } elseif (!(‘open’ == $post-> comment_status) && !(‘open’ == $post-
      >ping_status)) {
    -  // Neither Comments, nor Pings are open ?>
    -  Both comments and pings are currently closed.
    - <?php } ?>
    - </p>
    -  <?php /* If this is a monthly archive */ } elseif (isset($_GET[‘paged’]) &&!
      empty($_GET[‘paged’])) { ?>
    -  weblog archives.</p>
    -  <?php } ?>
    -  <?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
    - <li id=”contacts”><h2>Contacts</h2>
 *  - <?php wp_list_cats(); ?>
 * <li id=”pages”><h2>Pages</h2>
    - <?php wp_list_pages(‘sort_column=menu_order&title_li=’); ?>
 * <?php if (function_exists(‘wp_theme_switcher’)) { ?>
    -  <li id=”themes”><h2><?php _e(‘Themes’); ?></h2>
    -  <?php wp_theme_switcher(); ?>
    -  <?php } ?>
    - <li id=”archives”><h2>Archives</h2>
 *  - <?php get_archives(); ?>
 * <li id=”categories”><h2>Categories</h2>
    - <?php wp_list_cats(); ?>
 * <li id=”links”><h2>Links</h2>
    - <?php wp_list_cats(); ?>
 * <li id=”blogs”><h2>Blogs</h2>
    - <?php wp_list_cats(); ?>
 * <?php /* If this is the home page */ if (is_home()) { ?>
 * <?php get_links_list(); ?>
 * <?php } ?>
 *  </div>

The topic ‘Sidebar – adding sections’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [bogiesbl](https://wordpress.org/support/users/bogiesbl/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/sidebar-adding-sections/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
