Title: Archiving Technique
Last modified: August 18, 2016

---

# Archiving Technique

 *  [deydas](https://wordpress.org/support/users/deydas/)
 * (@deydas)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/archiving-technique/)
 * Hi!
 * I want to make my Date Archives like this:
 * Feb 2005 (15) — the number of posts
    Jan 2005 (12) Year 2004 (81) Year 2003 (
   89)
 * …etc.
 * Is there a way to do it in WP?

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

 *  [Michael Adams (mdawaffe)](https://wordpress.org/support/users/mdawaffe/)
 * (@mdawaffe)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/archiving-technique/#post-136392)
 * Hm… I don’t know if there’s a better way to do this. If someone comes along and
   says there is, I’d use her or his method over this one since this involves editing
   the core.
 * But, here goes:
 * You need to edit 3 lines of `wp-includes/template-functions-general.php`
 * line **206**
    change `global $querystring_start, $querystring_equal, $querystring_separator,
   $month, $wpdb;` to `global $querystring_start, $querystring_equal, $querystring_separator,
   $month, $month_abbrev, $wpdb;`
 * line **252**
    change `$text = sprintf("%s %d", $month[zeroise($arcresult->month,
   2)], $arcresult->year);` to `$text = sprintf("%s %d", $month_abbrev[$month[zeroise(
   $arcresult->month,2)]], $arcresult->year);`
 * line **255**
    change `$text = sprintf("%s %d", $month[zeroise($arcresult->month,
   2)], $arcresult->year);` to `$text = sprintf("%s %d", $month_abbrev[$month[zeroise(
   $arcresult->month,2)]], $arcresult->year);`
 * This is all assuming you use version 1.2.2. If you use an earlier version, the
   changes, _I think_, are the same, but the line numbers may differ.
 * EDIT: That will get you your month abbreviations. To get the number of posts,
   all you have to do is use
 * `<?php wp_get_archives('type=monthly&show_post_count=1'); ?>`
 * in your index.php.
 *  Thread Starter [deydas](https://wordpress.org/support/users/deydas/)
 * (@deydas)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/archiving-technique/#post-136404)
 * Tha would produce the list like
 * Feb 2005 (no. of posts)
    Jan 2005 (no. of posts) Dec 2004 (no. of posts)
 * But I want it like this:
 * Feb 2005 (no. of posts)
    Jan 2005 (no. of posts) Year 2004 (no. of posts)
 * Is there a way?!
 *  Thread Starter [deydas](https://wordpress.org/support/users/deydas/)
 * (@deydas)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/archiving-technique/#post-136426)
 * Anyone?!
 *  Thread Starter [deydas](https://wordpress.org/support/users/deydas/)
 * (@deydas)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/archiving-technique/#post-136476)
 * I have found what I was looking for and guess what there is a [plugin](http://www.blindmuse.com/blog/2004/03/31/group-archives-by-year/)
   for it too. WP rocks!!!
 *  [williamhamby](https://wordpress.org/support/users/williamhamby/)
 * (@williamhamby)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/archiving-technique/#post-136971)
 * No plugin is necessary. All you had to do was go into template-functions-general.
   php and change
 *  if (!isset($r[‘show_post_count’])) $r[‘show_post_count’] = false;
 * and
 * function get_archives($type=”, $limit=”, $format=’html’, $before = ”, $after 
   = ”, $show_post_count = false) {
 * to
 *  if (!isset($r[‘show_post_count’])) $r[‘show_post_count’] = true;
 * and
 * function get_archives($type=”, $limit=”, $format=’html’, $before = ”, $after 
   = ”, $show_post_count = true) {
 * respectively.

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

The topic ‘Archiving Technique’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [williamhamby](https://wordpress.org/support/users/williamhamby/)
 * Last activity: [21 years, 1 month ago](https://wordpress.org/support/topic/archiving-technique/#post-136971)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
