我的循环不显示我所有相关的帖子,它应该显示以特定字母开头的所有帖子(如果是“”,那么它应该显示按人气排序的所有帖子)有什么问题吗?
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
if ($first_letter!=\' \') { $args = array (
\'posts_per_page\' => $posts_per_page,
\'taxonomy\' => $term->taxonomy,
\'term\' => $term->name,
\'post_type\' => $post_type,
\'orderby\' => \'title\',
\'order\' => \'ASC\',
\'paged\' => $paged); }
else {$args = array (
\'posts_per_page\' => $posts_per_page,
\'taxonomy\' => $term->taxonomy,
\'term\' => $term->name,
\'post_type\' => $post_type,
\'meta_key\' => \'post_views_count\',
\'orderby\' => \'meta_value_num\',
\'showposts\' => 160,
\'order\' => \'DESC\',
\'paged\' => $paged); }
$the_query = new WP_Query( $args );
$mam_global_where = \'\'; // Turn off filter
if ( $the_query->have_posts() ) {
$in_this_row = 0;
while ( $the_query->have_posts() ) {
$the_query->the_post();
if ($first_letter!=\' \'&&$first_letter!=\'\') { $first_letter = strtoupper(substr(apply_filters(\'the_title\',$post->post_title),0,1));}
if ($first_letter != $curr_letter) {
if (++$post_count > 1) { end_prev_letter(); }
start_new_letter($first_letter);
$curr_letter = $first_letter;
}
if (++$in_this_row > $posts_per_row) {
end_prev_row();
start_new_row();
++$in_this_row; // Account for this first post
} ?>
<a href="<?php the_permalink(); ?>" rel=.....</a>
</div> <!--end #post-->
<?php }
end_prev_letter();