Recent Posts get Duplicated

Hi, sorry about my english, I’m try to explain the best I can, and thank you in advance for your support and advice.

Ok i have the following code in a widget area, since i used this code before everything work ok, starting this year for some estrange reason now isn’t working:

This is the way that used to work:

Latest Videos Post (Proved Working Scenario)
3. Best warm-up exercises2 (date: Dec20, 2011, categories: [Videos, ExampleCat1], Image:featured image3)
2. Best warm-up exercises1 (date: Dec 5, 2011, categories: [Videos, ExampleCat1], Image:featured image2)

  1. Preventing concussion Video 1 (date: Dec 1, 2011, categories: [Videos, Preventing, ExampleCat2], Image:featured image1)

Here is the code that i used:


<div class="video_area">
  <h2 class="widgettitle">Latest Videos</h2>
  <?php global 
  $recentPosts = new WP_Query(); $recentPosts->query('showposts=3&cat=33');?>
  <ul class="video_list">
    <?php $i = 1; while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
    <li><a href="<?php the_permalink() ?>" rel="bookmark"><img src="/images/videoscreen<?php echo $i; ?>.png">
      <?php  short_title(); ?>
      </a></li>
    <?php $i++; endwhile; ?>
<?php rewind_posts(); ?>
  </ul>
</div>

Now is working like this:

Latest Videos Post (Proved Working Scenario)
4. Best warm-up exercises3 (date: Jan 3, 2012, categories: [Videos, ExampleCat1], Image:featured image4) [B]<– This is not showing[/B]
Instead Shows the following:
3. Best warm-up exercises2 (date: Dec 20, 2011, categories: [Videos, ExampleCat1], Image:featured image3)
2. Best warm-up exercises1 (date: Dec 5, 2011, categories: [Videos, ExampleCat1], Image:featured image2)

  1. Best warm-up exercises2 (date: Dec 20, 2011, categories: [Videos, ExampleCat1], Image:featured image3)

In the dashboard the post are there, i used the wp reset loop (doesn’t work) and wp version: 3.2.1, i try to reset the cache and also doesn’t work either.

Thanks in advance for any suggestion or hint.

When using a custom post query in WordPress you need to always reset the loop back to it’s original state otherwise it will continue to run the original loop, instead of using rewind_posts() use wp_reset_postdata()

Hello, thanks for your replay, i try wp_reset_postdata() replacing the rewind_posts() and the problem still there.

Shouldn’t it be wp_reset_query()?

Thank you for your response @kohoutek.

I also used the wp_reset_query() and still the same, also occurs with the default widget of recent posts, i disable the code and other plugins that in some way do the same as the code posted. The problem still there, i cannot disable all the plugins because i will lost the other widgets, if some knows a way i can disable all the plugins without losing the widgets when i restore them it would be great.

Thanks all.