0

「ニュース」カテゴリのすべての投稿を収集するブログ ページがありますが、すべての投稿は同じ日付 (2013 年 5 月 5 日) を示していますが、曜日の名前が異なります。

これはコードです:

$wp_query = new WP_Query();
$wp_query->query('post_type=post&category_name=news&paged='.$paged);
?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>

    <div class="post" id="post-<?php the_ID(); ?>">
        <div class="title">
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <div class="postmeta">  <span>Posted on  <?php the_time('l, n F Y'); ?></span></div>

これは the_time 出力です:

Posted on Saturday, 5 May 2013

Posted on Tuesday, 5 May 2013

Posted on Tuesday, 5 May 2013

Posted on Monday, 5 May 2013

5 月 5 日に投稿またはページが 1 つも投稿されていません... これを修正する方法がわかりません... 助けてください!

編集:

問題が見つかり、これを変更しました:

<?php the_time('l, n F Y'); ?>

これとともに:

<?php the_time('l, j F Y'); ?>
4

2 に答える 2

1

あなたの問題は<?php the_time('l, n F Y'); ?>. 指定したはn、月の数値を参照します。必要なのは.May5j

<?php the_time('l, j F Y'); ?>
于 2013-05-20T12:58:21.913 に答える
0
Go wp-admin in "post" option edit your post is "Published on" option edit set your date and time.
same step in page option.
于 2013-05-20T12:25:22.277 に答える