我在WordPress中制作了一个自定义循环,出于某种原因,日期会随机跳过,尽管其他文章内容每次都能成功引入。WordPress the_date跳过循环内的间隔
任何想法,因为它完全让我莫名其妙!
例如,文章列表,当日期丢失:
- 日期
- 日期
- 没有日期
- 日期
- 日期
- 没有日期
- 日期
- 不是TE
- 没有日期
- 没有日期
下面是代码,包括所有的循环:
<?php query_posts('category_name=News&posts_per_page=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<article>
<div>
<p>PUBLISHED: <?php the_date(); ?></p>
<h4><a class="news_title_link" href="<?php the_permalink();?>"><?php the_title();?></a></h4>
<?php the_excerpt(); ?>
<br />
<a href="<?php the_permalink();?>">Read more</a>
</div>
<div>
<?php if (function_exists('get_the_image')) { get_the_image(array('default_size' => 'thumbnail','default_image' => '/wp-content/uploads/2010/06/default-thumb.jpg'));} ?>
</div>
</article>
<?php endwhile; ?>
<?php endif;?>
随机,你的意思是每次刷新后发布的日期与前一页加载的时间完全不同? – BoltClock 2010-07-19 11:11:32
不,它们按我在列表中指定的顺序排列。我应该改变这个问题,因为它是误导性的。 – theorise 2010-07-19 11:13:25