Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress存档小部件中的月份缩写_Wordpress_Archive_Abbreviation - Fatal编程技术网

Wordpress存档小部件中的月份缩写

Wordpress存档小部件中的月份缩写,wordpress,archive,abbreviation,Wordpress,Archive,Abbreviation,我已经连续三天试图让archives小部件以包含在locale.php中的缩写形式显示月份,但运气不佳 到目前为止,我只讲这段代码,其中月份名称源自general-template.php: if ( $arcresults ) { $afterafter = $after; foreach ( (array) $arcresults as $arcresult ) { $url = get_month_link( $arcresu

我已经连续三天试图让archives小部件以包含在locale.php中的缩写形式显示月份,但运气不佳 到目前为止,我只讲这段代码,其中月份名称源自general-template.php:

    if ( $arcresults ) {
        $afterafter = $after;
        foreach ( (array) $arcresults as $arcresult ) {
            $url = get_month_link( $arcresult->year, $arcresult->month );
            /* translators: 1: month name, 2: 4-digit year */
            $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
            if ( $show_post_count )
                $after = ' ('.$arcresult->posts.')' . $afterafter;
            $output .= get_archives_link($url, $text, $format, $before, $after);
        }
我确实在同一个文件中找到了日历小部件的缩写月份。但由于知识有限,我无法将其应用于档案:

if ( $previous ) {
    $calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="' . esc_attr( sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year)))) . '">&laquo; ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
} else {
    $calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
}
if($previous){
$calendar\u输出=“\n\t\t”。”;
}否则{
$calendar\u输出=“\n\t\t”。”;
}
有谁能给我一些提示或帮助我使用get_month_abbrev功能在档案馆工作


提前谢谢

好的。所以一个朋友帮我破解了这个

进入general-template.php并

替换:

            $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
与:

谢谢大家。。希望它能帮助更多的人

(在Wordpress 3.5.1中,文件路径为:“Wordpress\wp includes\general template.php”,该字符串位于第937行)

            $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month_abbrev($wp_locale->get_month($arcresult->month)), $arcresult->year);