Php WordPress博客日期函数

Php WordPress博客日期函数,php,wordpress,Php,Wordpress,我正在使用一个名为Scott Wallick的人创建的WordPress博客主题。这是他的网站。仅供参考,我用的是“巴塞尔姆”主题 无论如何,这个主题打印出的日期如下:2009年8月5日显示为“2009 08 05”。我想将显示更改为以下格式:2009年8月5日 我该怎么做 我在WordPress代码中找到了下面的函数。我可以改变下面的代码,让它按照我上面的要求运行吗?如果是,我应该做什么更改 function barthelme_date_classes($t, &$c, $p = '

我正在使用一个名为Scott Wallick的人创建的WordPress博客主题。这是他的网站。仅供参考,我用的是“巴塞尔姆”主题

无论如何,这个主题打印出的日期如下:2009年8月5日显示为“2009 08 05”。我想将显示更改为以下格式:2009年8月5日

我该怎么做

我在WordPress代码中找到了下面的函数。我可以改变下面的代码,让它按照我上面的要求运行吗?如果是,我应该做什么更改

function barthelme_date_classes($t, &$c, $p = '') {
    $t = $t + (get_option('gmt_offset') * 3600);
    $c[] = $p . 'y' . gmdate('Y', $t);
    $c[] = $p . 'm' . gmdate('m', $t);
    $c[] = $p . 'd' . gmdate('d', $t);
    $c[] = $p . 'h' . gmdate('h', $t);
}
请尝试以下操作:

function barthelme_date_classes($t, &$c, $p = '') {
    $t = $t + (get_option('gmt_offset') * 3600);
    $c[] = $p . 'j' . gmdate('j', $t);
    $c[] = $p . 'M' . gmdate('M', $t);
    $c[] = $p . 'Y' . gmdate('Y', $t);
    $c[] = $p . 'h' . gmdate('h', $t);
}

我刚刚更改了每个日期元素的存储顺序,并使用了您要求的格式。

在Barthelme主题中,index.php的第23行显示

<span class="entry-date">
<abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>">
<?php unset($previousday); printf(__('%1$s', 'barthelme'), the_date('Y m d', false)) ?>
</abbr>
</span>


我试过了,但没什么改变。。。还有其他想法吗?谢谢
<span class="entry-date">
<abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>">
<?php unset($previousday); printf(__('%1$s', 'barthelme'), the_date('j M Y', false)) ?>
</abbr>
</span>