Support » Themes and Templates » Prevent same post in multiple loops
5 years, 10 months ago
I’m using this on my single.php to retrieve both the similar posts (using the same tags) and the popular posts (using comment count) as well. There is a problem, though. How to prevent similar posts to show up as popular posts too?
turn all tag ids into one array;
use the ‘post__not_in’ in the second loop, with an array of collected post ids.
Ah, dumb me — I completely forgot I could do that using ‘post__not_in’. Thank you!