Do not duplicate not working
-
For some reason I cannot understand do not duplicate is not working for me. Below is the code I am using. There are only two loops a query posts and the normal WP loop.
Any help much appreciated!
<?php $do_not_duplicate = array(); ?> <!-- Featured Posts --> <?php $my_query = new WP_Query('tag=sticky&posts_per_page=3'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <-- Outputs three posts here--> <?php endwhile; ?> <!-- Normal Loop --> <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; ?> <-- Outputs the rest of the posts here--> <?php endwhile; endif; ?> <!-- But there are still duplicates? -->
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Do not duplicate not working’ is closed to new replies.