Title: Archives Page Question
Last modified: August 18, 2016

---

# Archives Page Question

 *  [Roar](https://wordpress.org/support/users/rori/)
 * (@rori)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/archives-page-question/)
 * I tried to search, I just cannot think of even how to phrase it.
 * On an archive page, it is not pulling in the whole sidebar, where if someone 
   was browsing the March 2004 archives, and then they wanted to go to April, they
   have to go all the way back to the main page, and then go to archives again, 
   and then select from there.
 * Help?
    is there a way to have the list of the archives months show on the archive
   page in the sidebar?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [eridan](https://wordpress.org/support/users/eridan/)
 * (@eridan)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/archives-page-question/#post-185541)
 * You could put something like <?php if is_archive() { wp_get_archives(‘type=monthly&
   limit=12’); } ?> in your sidebar
 *  Thread Starter [Roar](https://wordpress.org/support/users/rori/)
 * (@rori)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/archives-page-question/#post-186054)
 * This is what I used:
    `<li><h2><?php _e('Archives'); ?></h2><ul><?php if is_archive(){
   wp_get_archives('type=monthly'); } ?></ul></li>`
 * and I get a parse error
 * Parse error: parse error, unexpected T_STRING, expecting ‘(‘ in
 *  Thread Starter [Roar](https://wordpress.org/support/users/rori/)
 * (@rori)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/archives-page-question/#post-186055)
 * Okay, I cleaned the code to:
 * `<li><h2><?php _e('Archives'); ?></h2>
    <ul><?php if (is_archive() ) wp_get_archives('
   type=monthly'); ?></ul></li>
    but it still does not work.
 * Help?
 *  [dmetzcher](https://wordpress.org/support/users/dmetzcher/)
 * (@dmetzcher)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/archives-page-question/#post-186153)
 * The simplest way to do this is create a new sidebar and make the following changes
   to the archives.php file.
 * First, do a Save As of the sidebar.php file. Save it as sidebar-for-archives.
   php. Now you have a file to include.
 * Next make the following changes.
    1. Line 9 of archives.php: Change `<div id="
   content" class="widecolumn">` to `<div id="content" class="narrowcolumn">`.
 * 2. archives.php: Right above the last line (`<?php get_footer(); ?>`), insert
   this as a new line and add `<?php get_footer(); ?>`.
 * These changes will do two things:
    First, you will tell archives.php to use a
   narrow column, which will allow room for a sidebar. Second, you will tell archives.
   php to include sidebar-for-archives.php as its sidebar.
 * You can then customize sidebar-for-archives.php any way that you like. I have
   removed the code in this file that shows archives by month and category, because
   archives.php is already doing this.
 * You can do this on any page, really. I am even doing it on my individual post
   pages to include a different sidebar than the normal one on the index.php page.
   I wanted one that was shorter, because I include long advertizing on the index.
   php sidebar, and this looks bad on a page with a short post.
 * Good luck! Read the WordPress codex ([http://codex.wordpress.org](http://codex.wordpress.org)).
   There is a section on customizing the sidebar (just type “customizing the sidebar”
   in the search field). That’s where I learned how to do this.
 *  [dmetzcher](https://wordpress.org/support/users/dmetzcher/)
 * (@dmetzcher)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/archives-page-question/#post-186154)
 * A look at your blog shows me that you have already learned how to do this. Hope
   it helps someone else with the same question in the future. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Archives Page Question’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [dmetzcher](https://wordpress.org/support/users/dmetzcher/)
 * Last activity: [20 years, 10 months ago](https://wordpress.org/support/topic/archives-page-question/#post-186154)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
