Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.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:the_time返回wierd日期_Wordpress_Date_Time - Fatal编程技术网

wordpress:the_time返回wierd日期

wordpress:the_time返回wierd日期,wordpress,date,time,Wordpress,Date,Time,我有一个博客页面,收集“新闻”类别中的所有帖子,但所有帖子都显示相同的日期(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

我有一个博客页面,收集“新闻”类别中的所有帖子,但所有帖子都显示相同的日期(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>
5月5日没有一篇文章或一页发表。。。我不知道怎么解决这个问题。。。请帮忙

编辑:

发现问题,更改此:

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

为此:

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


您的问题在于
。您指定的
n
是指月份的数字,
May
5
。您需要的是
j

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


发布日期各不相同永久链接和标题是否正常?
Go wp-admin in "post" option edit your post is "Published on" option edit set your date and time.
same step in page option.
<?php the_time('l, j F Y'); ?>