Would like to try an alternate loop suggestion please.
-
OK, here is the situation. I use the following loop in order to have blog posts appear in the index.php except for the category ‘pensees’.
Then the latest blog from that category is displayed in the sidebar.php (which is called before in the loop).
sidebar.php:
<?php $my_query = new WP_Query('category_name=pensees&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <?php the_content(__('(more...)')); ?> <?php endwhile; ?>
index.php:
<?php get_sidebar(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?> <?php if (in_category('7') && is_home() ) continue; ?> <?php the_content(__('(more...)')); ?> <?php endwhile; else: ?> <?php endif; ?> <?php get_footer(); ?>
Here is the problem. It seems to work fine but it breaks one of my plugin. So I would like to know if there was an alternate way to achieve this multiple loop.
Please also note that when I call sidebar.php after the index.php’s loop it works perfectly but mess up the design.
Any suggestions!?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Would like to try an alternate loop suggestion please.’ is closed to new replies.