WordPress PHP - Post duplicates in 2 loops
A quick and simple way to knock out duplicates if you have 2 Loops on the page
The first loop will look something like this:-
$duplicates = array();
$my_query = new WP_Query(’category_name=Car Insurance&showposts=8′);while ($my_query->have_posts()) {
$my_query->the_post();
$duplicates[] = $post->ID;
//print out the 1st loop posts
}
so this gives you an array of post ids to check against the posts of the second loop, and inside this you use the condition
if (!in_array(get_the_ID(),$duplicates)){
// print out the 2nd loop posts
}











