2013-05-20 42 views
0

我有收集在「新聞」類別中的所有職位的博客頁面,但所有的帖子顯示相同的日期(5 2013年5月),但本週WordPress的:the_time返回奇怪的日期

這天不同的名稱是代碼:

$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日...我不知道解決這個問題......請幫助!

編輯:

發現問題,改變了這個:

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

與此:

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

the permalink&titles are ok? – Xavier

回答

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. 
+0

帖子日期都不一樣 –

1

你的問題是與<?php the_time('l, n F Y'); ?>。您指定的n是指月份的數字編號,May5。你需要的是j

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