In get_posts, exclude posts where comments are closed?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘In get_posts, exclude posts where comments are closed?’ is closed to new replies.
The topic ‘In get_posts, exclude posts where comments are closed?’ is closed to new replies.
(@mjbanks)
15 years, 5 months ago
Hi everyone,
I’m writing a script to display popular posts on my site by comment count, but I want to exclude any posts whose comments are closed (ie old contests with thousands of comments, but no longer active).
Here’s the code I’m using now: http://wordpress.pastebin.com/m9KGLWxR
Is there any way to modify the get_posts query so that it excludes any posts whose comments have been closed?
Thanks!
Matt