multiple loop and duplicate post problem
-
Hi all, i have the first post, then i get other posts from a category. The problem is that if i get only the first post is all ok, if get 2 or more posts these will be duplicated. Here is my code:
in the first div
<?php
$my_query = new WP_Query(‘showposts=1&cat=-6,-8’);
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;?>in the div where posts are duplicated:
<?php
$catname = catname;
$wp_query = new WP_Query();
$wp_query->query(‘category_name=’.$catname.’&showposts=5′.’&paged=’.$paged);
?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<?php if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
- The topic ‘multiple loop and duplicate post problem’ is closed to new replies.