Wordpress两个嵌套循环
我想公开一个关于Wordpress中两个循环集成的问题。 我有一个滑块(来自WP Coda滑块插件),它调用页面:Wordpress两个嵌套循环,wordpress,loops,slider,Wordpress,Loops,Slider,我想公开一个关于Wordpress中两个循环集成的问题。 我有一个滑块(来自WP Coda滑块插件),它调用页面: <?php query_posts('post_type=page&orderby=title&order=asc'); ?> <div class="scrollContainer"> <?php while (have_posts()) : the_post(); ?> <div class="panel" id="&l
<?php query_posts('post_type=page&orderby=title&order=asc'); ?>
<div class="scrollContainer">
<?php while (have_posts()) : the_post(); ?>
<div class="panel" id="<?php echo $post->post_name ; ?>">
<?php the_content(); ?>
</div>
<?php endwhile;?>
</div>
为什么不在第二个循环中使用get_posts?我认为这会解决你的问题:
<?php query_posts ('post_type=post&order=desc'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a rel="group_news" href="<?php the_permalink() ; ?>"><?php the_title(); ?></a><?php echo ' ' ?><?php comments_number('No Comments','1 Comment','% Comments'); ?></li><?php endwhile;?>
<?php wp_reset_query(); ?>