【发布时间】:2010-08-19 03:13:31
【问题描述】:
我在 Wordpress 博客的侧边栏中有一个最近的帖子列表。标题和作者正确显示,但显示的摘录是当前页面/帖子的摘录,而不是相关最近的帖子。
代码:
<?php $myposts = get_posts('numberposts=10&offset=0');
foreach($myposts as $post) :?>
<li><a href="<?php the_permalink(); ?>"><?php the_title();?> <span>by <?php the_author(); ?></span></a> <br /> <?php the_excerpt(); ?></li>
<?php endforeach; ?>
知道为什么它会提取正确的标题/作者,但摘录不正确吗?
【问题讨论】:
标签: wordpress