Title: Multiple loops and IF
Last modified: August 18, 2016

---

# Multiple loops and IF

 *  [Brody](https://wordpress.org/support/users/brody/)
 * (@brody)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/multiple-loops-and-if/)
 * For some reason after I started to use multiple loops (one in sidebar and one
   on index page) the IF construction is not working any more.
 * Loop 1 (sidebar):
 * <?php query_posts(“cat=6&showposts=10”); ?>
    <?php while (have_posts()) : the_post();?
   > <b>” rel=”bookmark”><?php the_title(); ?></b> (<?php the_time(‘F j, Y’); ?>)
   <?php endwhile; ?>
 * Loop 2 (index):
 * <?php rewind_posts(); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post();?
   > <!– Some code //–> <?php endwhile; ?>
 * And finally IF expression in sidebar:
 * <?php if ( is_home() ) {Some statement 1} else {Some statement 2} ?>
 * Thanks for help in advance!!!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Brody](https://wordpress.org/support/users/brody/)
 * (@brody)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/multiple-loops-and-if/#post-367574)
 * No ideas?
 *  Thread Starter [Brody](https://wordpress.org/support/users/brody/)
 * (@brody)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/multiple-loops-and-if/#post-367861)
 * 🙁

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multiple loops and IF’ is closed to new replies.

## Tags

 * [loops](https://wordpress.org/support/topic-tag/loops/)
 * [multiple](https://wordpress.org/support/topic-tag/multiple/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [Brody](https://wordpress.org/support/users/brody/)
 * Last activity: [20 years, 1 month ago](https://wordpress.org/support/topic/multiple-loops-and-if/#post-367861)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
