Wordpress Archive Dates
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;
- Edit your wp-includes/templates-functions-general.php file, and look for the get_archives function (line 298 in WP 2.0).
- At the top of the function change the the line “global $month, $wpdb;” to “global $month, $month_abbrev, $wpdb;”
- 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




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. [...]