Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress两个嵌套循环_Wordpress_Loops_Slider - Fatal编程技术网

Wordpress两个嵌套循环

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

我想公开一个关于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="<?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 '&nbsp;&nbsp;&nbsp;' ?><?php comments_number('No Comments','1 Comment','% Comments'); ?></li><?php endwhile;?>
<?php wp_reset_query(); ?>