Query only posts with active comments
-
How should I modify this code to query only posts where comment status is active? (Comment status automatically become closed after 20 days on my site, so I need to query posts only with active comments.)
<?php $myqueryname = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query('author='1'&post_status=publish'); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> LOOP <?php endwhile; ?> <?php else : ?> <h1>No results.</h1> <?php endif; ?> <?php $wp_query = null; $wp_query = $myqueryname;?>
Can anyone please help?
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Query only posts with active comments’ is closed to new replies.