2009-08-29 9 views
2

私はScott Wallickという名前の人が作成したWordPressブログテーマを使用しています。 Hereは彼のウェブサイトです。参考までに、私は "Barthelme"テーマを使用しています。ワードプレスのブログ日付機能

とにかく、このテーマは次のように日付を表​​示します: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); 
} 

答えて

2

次のことを試してみてください。

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テーマで

+0

<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> 

変更、それを読み、私はこれを試してみましたが、それは...他のアイデアを何も変更しませんでしたか?ありがとう。 – John

0

、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('j M Y', false)) ?> 
</abbr> 
</span>