Support » Fixing WordPress » Problem with Wp-query

  • setnaps


    Hi. Good evening to all.
    I just upgrade to the last release of wordpress and something happened..

    I have the following code

    <div id="thumbnails">
    		 $the_query = new WP_Query('category_name=' . '&showposts=200&cat=304&orderby=date&order=desc');
    		 $counter = 0;
    		 while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
    		 	<div id="shop149clean">
    		 	<a href="<?php the_permalink() ?>" rel="bookmark"><?php if ( has_post_thumbnail() ) the_post_thumbnail( 'mini144-thumb' ); ?></a>
             <?php endwhile; ?>

    the results of that you can see properly in this page

    But, when I want to create a page template, if I add the same code to the template, something very weird happens, which is that the last POST gets duplicated in the first position, while the first post dissappears…

    Check what I mean here

    Does anybody know why this happens????

    Thank you very much

Viewing 4 replies - 1 through 4 (of 4 total)
  • deepbevel


    that is odd, are you by chance running another loop on the same page?



    Hi Deepbevel..
    Thanks for answering…
    Well, I don’t use any other loop in the template page. I didn’t have this problem in the previous version of WordPress…something happened when I upgraded…

    so strange

    Moderator keesiemeijer



    Why is ‘category_name’ in the query? try it with:

    $the_query = new WP_Query('posts_per_page=200&cat=304&orderby=date');

    – deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the default theme to rule out any theme-specific problems.



    Placing the plugin call there will result in the correct pagination. You’ll get funky paging errors if it’s placed after the whole $wp_query variable swapping in the end.

    [link removed]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with Wp-query’ is closed to new replies.