1,973   WordPress

 

在文件wp-includes/general-template.php的函数 function wp_get_archives($args = ”)

 

默认采用月份显示

if ( ” == $type )

$type = ‘monthly’;

 

日期显示方式

$text = sprintf(__(‘%1$s %2$d’), $wp_locale->get_month($result->month), $result->year);

 

第一个%1$s为月份,第二%2$d为年份,后面参数对应;

 

按要求修改,将年份放前面,同时月份采用数字形式

$text = sprintf(__(‘%1$d/%2$s’), $result->year,zeroise(intval($result->month), 2));

 

 

参考链接:

http://www.cnblogs.com/vengen/archive/2010/04/01/1702338.html




Leave a Reply

Your email address will not be published. Required fields are marked *