How can I change the way dates shown in the archive widget?

For archives you can use the get_archives_link filter like this:

add_filter('get_archives_link', 'translate_archive_month');
function translate_archive_month($list) {

  $patterns = array( 
    '/January/', '/February/', '/March/', '/April/', '/May/', '/June/',
    '/July/', '/August/', '/September/', '/October/',  '/November/', '/December/'
  );

  $replacements = array( //PUT HERE WHATEVER YOU NEED
    '01.', '02.', '03.', '04.', '05.', '06.', 
    '07.', '08.', '09.', '10.', '11.', '12.'
  );    

  $list = preg_replace($patterns, $replacements, $list);
return $list; 
}

Hope it helps.

Leave a Comment