2006-01-06

Wordpress Archive Dates

by Yorrike @ 1034 UTC, in

I’ve been trying to get better control over those pesky archive dates in the right hand menu for as long as I’ve been using wordpress, specifically shortening the month names from their full versions to 3 letter abbreviations.

Even though Wordpress is awesome, it does feature some rather frustrating limitations on displaying things in certain ways, so I took it upon myself to fix the date format and this is what’s involved;

  1. Edit your wp-includes/templates-functions-general.php file, and look for the get_archives function (line 298 in WP 2.0).
  2. At the top of the function change the the line “global $month, $wpdb;” to “global $month, $month_abbrev, $wpdb;”
  3. In the same function, find and change the second line that reads “$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 343 in WP 2.0)

And you’ll be left with smaller, nicer looking archive month names in the menu while keeping the longer names when the archives are called for within the page’s content.

One Response to “Wordpress Archive Dates”

Keep track of this discussion by subscribing to the comment feed

  1. 01

    by Yorrike.com » Behold - The New Theme @ 2006-02-11 0459 UTC

    [...] I’ve been wanting to reduce the complexity of Yorrike.com for a while now, firstly with the now redundant WP short archive month hack I posted about (below) and now with a totally new take on the colour and structural theme I’ve had running on this site for a while. [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

If you haven't posted a comment here before, your comment will not appear until I have approved it

 

Except where otherwise noted, content on this site is licensed under a
Creative Commons Attribution 2.5 License

| W3C Compliant XHTML 1.1 | W3C Compliant CSS