2011-10-11 18 views
0

我一直在嘗試連續3天沒有運氣,使檔案小部件顯示在其縮略形式包含在locale.php 到目前爲止,我是這件作品的代碼,其中的月份名稱在一般的template.php來源:在WordPress的月份縮寫檔案部件

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>'; 
} 

任何人都可以請給我一些提示或幫助我用get_month_abbrev功能在檔案工作?

在此先感謝!

回答

0

好的。所以朋友幫我解決了這個問題。

進入一般的template.php和

取代:

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

有:

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

謝謝大家..希望它能幫助更多的人在那裏。

(在Wordpress 3.5.1中,文件路徑是:'wordpress \ wp-includes \ general-template.php',這個字符串在937行)