我的单曲。php我想显示当前帖子,在它下面我想列出cat-2中的所有帖子。在我的循环中,我试图用cat-2查询帖子,但它仍然显示当前帖子。
<?php global $query_string;
$posts = query_posts($query_string.\'\'); ?>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<h4><?php the_title(); ?></h4>
<?php endif; ?>
<?php the_content(); // Dynamic Content ?>
<?php edit_post_link(); ?>
<?php endwhile; ?>
<?php else: ?>
<h1><?php _e( \'Sorry, nothing to display.\', \'html5blank\' ); ?></h1>
<?php endif; ?>
<?php rewind_posts(); ?>
<hr>
<?php global $query_string; // required
$posts = query_posts($query_string.\'&cat=2,&order=ASC\'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><img title="<?php the_title(); ?>" alt="<?php the_title(); ?>" class="wp-post-image" src="<?php the_post_thumbnail_url(); ?> " style="width:100%; height:auto;"></a>
<h4><?php the_title(); ?></h4>
</div>
</div>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
<?php wp_reset_query(); // reset the query ?>