我试图循环所有类别中的所有最新帖子,但它只显示单个类别中的一篇帖子。下面是我正在使用的代码。
<?php while (have_posts()) : the_post(); ?>
<li <?php post_class() ?> id="post-<?php the_ID(); ?>">
<a class="wpn_title" href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<div class="wpn_info">
<?php echo get_avatar( get_the_author_email(), \'40\' ); ?>
by <?php the_author_posts_link() ?><br />
Posted <?php the_time(\'F jS, Y \\a\\t g:i a\') ?>
</div>
<div class="wpn_post">
<?php wpn_content_limit(get_the_content(),500); ?>
</div>
<div class="wpn_bottom">
<a class="wpn_comments" href="<?php the_permalink() ?>#comments"><strong><?php comments_number(__(\'0\'), __(\'1\'), __(\'%\')); ?></strong> Comments</a>
<a class="wpn_continue" href="<?php the_permalink() ?>">Continue Reading</a>
</div>
</li>
<?php endwhile; ?>
PS:
看起来这个问题是由我放在索引顶部的以下代码引起的。php。我错过了什么吗?
<ul class="list">
<?php query_posts(\'r_sortby=highest_rated&r_orderby=DESC&showposts=4&cat=9\') ?>
<?php while (have_posts()) : the_post(); ?>
<li>
<span class="num"><?php $key="ratings_users"; echo get_post_meta($post->ID, $key, true); ?></span>
<a class="img" href="<?php echo get_permalink(); ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'top-score-thumb\' ); } ?></a>
<div class="text"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_titlesmall(\'\', \'...\', true, \'20\') ?></a></div>
</li>
<?php endwhile; ?>
</ul>