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; ?>
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.