title: Multiple Loops in WordPress. Second loop not resetting
body: <p>I've created a custom post type with custom fields inside Wordpress.  I created a new page template that runs through a loop and that works great.  I'm trying to add a similar loop to the home page's sidebar but it doesn't work correctly.</p>
  
  <p>First, the working code on my own page template.</p>
  
  <pre><code>&lt;h2&gt;Upcoming Events&lt;/h2&gt;
  &lt;?php $todaysDate = date('Y/m/d');
  $event_query = new WP_query('post_type=events&amp;posts_per_page=-1&amp;post_status=publish&amp;meta_key=event_date&amp;meta_compare=&gt;=&amp;meta_value=' . $todaysDate . '&amp;orderby=meta_value&amp;order=ASC');
  ?&gt; 
  
  &lt;ul id="featured_event_list"&gt;
  &lt;?php if ($event_query-&gt;have_posts()): ?&gt;
  &lt;?php while ($event_query-&gt;have_posts()) : $event_query-&gt;the_post(); ?&gt;
  &lt;li&gt;
      &lt;h3&gt;&lt;?php the_title(); ?&gt;&lt;/h3&gt;
      &lt;p&gt;
      &lt;?php if ( get_post_meta($post-&gt;ID, 'event_featuring', true) ) : ?&gt;
          &lt;strong&gt;Featuring:&lt;/strong&gt; &lt;?php echo get_post_meta($post-&gt;ID, 'event_featuring', true) ?&gt;&lt;br /&gt;
      &lt;?php endif; ?&gt;
      &lt;?php if ( get_post_meta($post-&gt;ID, 'event_date', true) ) : ?&gt;
          &lt;?php $event_date = get_post_meta($post-&gt;ID, 'event_date', true);
          $new_event_date = date("F j, Y",strtotime($event_date)); ?&gt;
          &lt;strong&gt;Date:&lt;/strong&gt; &lt;?php echo $new_event_date ?&gt;
          &lt;?php endif; ?&gt;
          &lt;?php if ( get_post_meta($post-&gt;ID, 'event_end_date', true) ) : ?&gt;
          &lt;?php $event_end_date = get_post_meta($post-&gt;ID, 'event_end_date', true);
          $new_event_end_date = date("F j, Y",strtotime($event_end_date)); ?&gt;
          - &lt;?php echo $new_event_end_date ?&gt;
      &lt;?php endif; ?&gt;
          &lt;br /&gt;
      &lt;?php if ( get_post_meta($post-&gt;ID, 'event_time', true) ) : ?&gt;
          &lt;strong&gt;Time:&lt;/strong&gt; &lt;?php echo get_post_meta($post-&gt;ID, 'event_time', true) ?&gt;&lt;br /&gt;
      &lt;?php endif; ?&gt;
      &lt;?php if ( get_post_meta($post-&gt;ID, 'event_location', true) ) : ?&gt;
          &lt;strong&gt;Location:&lt;/strong&gt; &lt;?php echo get_post_meta($post-&gt;ID, 'event_location', true) ?&gt;
      &lt;?php endif; ?&gt;
      &lt;/p&gt;
      &lt;p&gt;&lt;?php the_excerpt(); ?&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;?php endwhile; ?&gt;
  &lt;?php else: ?&gt;
  &lt;li&gt;Sorry, no upcoming events.&lt;/li&gt;
  &lt;?php endif; ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>That works fine, but when I put a modified version of that code as a widget inside of functions.php, it doesn't work:</p>
  
  <pre><code>&lt;?php
  function eventsWidget() { ?&gt;
      &lt;div class="uwf_widget"&gt;
          &lt;h3 class="events"&gt;&lt;span&gt;Featured Events&lt;/span&gt;&lt;/h3&gt;
          &lt;ul&gt;
  &lt;?php
          $todaysDate = date('Y/m/d');
          $event_widget_query = new WP_query('post_type=events&amp;posts_per_page=2&amp;post_status=publish&amp;meta_key=event_date&amp;meta_compare=&gt;=&amp;meta_value=' . $todaysDate . '&amp;orderby=meta_value&amp;order=ASC');
  ?&gt; 
          &lt;?php if ($event_widget_query-&gt;have_posts()) :?&gt;
          &lt;?php while ($event_widget_query-&gt;have_posts()) : $event_widget_query-&gt;the_post(); ?&gt;
              &lt;?php $event_date = get_post_meta($post-&gt;ID, 'event_date', true);
              $new_event_date = date("F j",strtotime($event_date)); ?&gt;
              &lt;li&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt; - &lt;?php echo $new_event_date; ?&gt; &amp;nbsp;&amp;raquo;&lt;/a&gt;&lt;/li&gt;
          &lt;?php endwhile; else: ?&gt;
              &lt;li&gt;Sorry, no upcoming events.&lt;/li&gt;
          &lt;?php endif; ?&gt;
          &lt;/ul&gt;
              &lt;p class="more"&gt;&lt;a href="/about-us/events/"&gt;more events &amp;raquo;&lt;/a&gt;&lt;/p&gt;
          &lt;/div&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>Now, if I put that code inside the normal sidebar (instead of on the homepage) - it works fine.  So, clearly there is something wrong with multiple loops on the home page and the sidebar.  If I simplify the widget so it only grabs 2 "events" it will grab two posts (regardless of the post_type).  I've tried rewind_posts and wp_reset_query, so I'm not sure what else to try?  </p>