Title: Code for Archives widget?
Last modified: August 19, 2016

---

# Code for Archives widget?

 *  [Kevin Kwok](https://wordpress.org/support/users/queesy/)
 * (@queesy)
 * [16 years ago](https://wordpress.org/support/topic/code-for-archives-widget/)
 * Hello, I am trying to manually input the code for the Archives widget within 
   my SIDEBAR.php but i cannot find the code anywhere.

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

 *  Thread Starter [Kevin Kwok](https://wordpress.org/support/users/queesy/)
 * (@queesy)
 * [16 years ago](https://wordpress.org/support/topic/code-for-archives-widget/#post-1452708)
 * ok i found out this code:
 *     ```
       <ul>
       <?php wp_get_archives('type=monthly'); ?>
       </ul>
       ```
   
 * but it doesnt show the number of posts each month has, any ideas?
 *  [jimisaacs](https://wordpress.org/support/users/jimisaacs/)
 * (@jimisaacs)
 * [16 years ago](https://wordpress.org/support/topic/code-for-archives-widget/#post-1452712)
 * [@queesy](https://wordpress.org/support/users/queesy/)
 * You are on the right track here. You are just looking for more arguments.
 * The following is pulled directly from the file “wp-includes/default-widgets.php”
   line 234.
 * > <?php wp_get_archives(apply_filters(‘widget_archives_dropdown_args’, array(‘
   > type’ => ‘monthly’, ‘format’ => ‘option’, ‘show_post_count’ => $c))); ?>
 * **$c** is simply a boolean set previously as a widget setting.
 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [16 years ago](https://wordpress.org/support/topic/code-for-archives-widget/#post-1452724)
 * > but it doesnt show the number of posts each month has, any ideas?
 * Try adding this and see if it looks ok to you : &show_post_count=1
 * `<?php wp_get_archives('type=monthly&show_post_count=1'); ?>`
 * Reference: [http://codex.wordpress.org/Template_Tags/wp_get_archives](http://codex.wordpress.org/Template_Tags/wp_get_archives)

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

The topic ‘Code for Archives widget?’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/code-for-archives-widget/#post-1452724)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
