I have a Custom Query that displays 5 posts that have a certain meta value (featured posts). On the same page, I have a regular old Loop. I would like to exclude the posts displayed in the Custom Query from the Loop. Another problem is that the Custom Query and The Loop are in different functions in the functions.php file so variable values don’t carry over between the two.
Any help would be greatly appreciated!
Basically, you’re building a slider and you don’t want the posts in the slider also showing up in the loop?
<?php query_posts(’showposts=8?); ?> <?php while (have_posts()) : the_post(); if (array_search(get_the_ID(), $do_not_duplicate) !== false) continue; update_post_caches($posts); ?> CONTENT GOES HERE <?php endwhile; ?>
Hmm… I tried that but I’m not sure what you mean by the variable $do_not_duplicate because when I apply that code, it gives me an error stating variable needs to be an array.