Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save carlaizumibamford/6348a43bc1667057fecb68c04587728f to your computer and use it in GitHub Desktop.
Save carlaizumibamford/6348a43bc1667057fecb68c04587728f to your computer and use it in GitHub Desktop.
Display posts with 20 comments:
$args = array(
'post_type' => 'post',
'comment_count' => 20,
);
$query = new WP_Query( $args );
Display posts with 25 comments or more:
$args = array(
'post_type' => 'post',
'comment_count' => array(
'value' => 25,
'compare' => '>=',
)
);
$query = new WP_Query( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment