PixelBin_DISABLED
PixelBin_DISABLED Recent Posts Threads Started
1479 posts The right tools with none of the gimmicks
  • Affiliate Level 4
  • Beta Tester
  • Collector Level 2
  • Weekly Top Seller
+5 more
PixelBin_DISABLED
says

Hi,

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!

629 posts
  • 7 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+4 more
VagrantRadio
says

Basically, you’re building a slider and you don’t want the posts in the slider also showing up in the loop?

629 posts
  • 7 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+4 more
VagrantRadio
says
<?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; ?>
PixelBin_DISABLED
PixelBin_DISABLED Recent Posts Threads Started
1479 posts The right tools with none of the gimmicks
  • Affiliate Level 4
  • Beta Tester
  • Collector Level 2
  • Weekly Top Seller
+5 more
PixelBin_DISABLED
says

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.

by
by
by
by
by
by