You might try this:
add_filter( 'posts_where', 'filter_where' );
$query = new WP_Query($args);
remove_filter( 'posts_where', 'filter_where' );
where
function filter_where( $where="" ) {
$where .= " AND comment_count > 0 ";
return $where;
}
to get posts with comments.
Related Posts:
- How to exclude latest x posts from a paginated query?
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Can’t show comments count per post outside loop
- Only display posts with comments
- How to output comments number of a post per day?
- Hide Post comments when displayed via WP_Query
- Hiding posts in a list from specified categories
- Display posts with comments closed, with pagination?
- How would I get 1 latest post from a query for 5 posts?
- How to get most recent commented post above new submitted post in WordPress?
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- Reset Popular post query?
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Random ajax load only works with posts_per_page set to -1
- posts_per_page option limits the number of Gallery items
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- why the same code got different results when using query_posts in functions.php and index.php
- Query for first 3 posts to change the look and feel
- How to get posts published on the latest date?
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- On what hook can I get the queried object’s final state?
- wp_query with ajax
- How to give classname to post if post has no content?
- WP_Query: Show 10 posts in date order, first three random
- Random posts that always include a particular post?
- WordPress post filter menu
- Query function not executed between element [closed]
- Echo the number of posts being displayed
- WordPress query portfolio posts
- Display 3 posts with different HTML markup using a loop
- Change content off every sixth element
- how to show comments only author which send own posts in wordpress
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- Multisite how to display merged posts from two sites and sort by latest date?
- Show 5 posts and than 3 posts offset with pagination
- wp_query args with relation
- Manipulate query to show specific post
- Sort / Filter Queries
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How do I control the fallback query after the original query returned cero posts?
- Remove duplicated posts in the loop if post has more than one category
- Adding a category at even positions on main loop with modified pagination
- query_posts different amount of posts per page [duplicate]
- Random sort within an already sorted query
- the_author() returns empty string
- Search by Hyphen
- How to display posts by current user/author in a custom page template?
- WordPress Number of Posts Not Changing With posts_per_page
- Query only Posts from Both of Two Category?
- Exclude posts with specific meta_value while sorting by a separate meta_value
- Comments enabled, but disabled at the same time
- Enable commenting on front-end preview page for pending posts
- Fetch posts from current week (Sunday to Saturday)
- Converting multiple loops into one single loop with pagination
- Exclude posts from featuring
- Lazy Load using WP_Query pagination
- Only display a certain number of posts, dependent on how many posts there are available in a query
- AJAX filter posts by year
- Diplay comment date on WP_Post_Comments_List_Table
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Yearly archive page for future year
- Custom WP_Query with complex ‘post_status’ argument
- How do I correctly set up a WP-Query to only show upcoming event-posts?
- Select only post id and meta value with WP_Query
- While loop articles – if statement order
- Get the amount of posts on a current page
- Post Filtering by GET URL parameters
- Related Posts function not working
- wp_query if have posts show date but not in loop
- Exclude a category of posts in author template
- Get posts from current category?
- Count the total views of all user posts published
- Why sorting posts doesn’t work properly?
- the wp_post_update isn’t working all the time
- Display specific posts based on an ID of another post
- Change URL of previous posts and next posts link in WordPress
- long-title posts do not want published
- WordPress weird behaviour on comments
- WP_Query sort by meta_value_num or date
- Repeating post how to solve this
- Can’t get pagination to work
- Display the first post’s comments of category in comments.php template
- How to get single post by one author?
- How to modify this function to exclude also the post belonging to a specific category?
- List posts related to category on a div [closed]
- How does WordPress add the comments and comment form to posts
- Sort Posts Alphabetically Based on Specific Category (Divi)
- Undefined Function Fatal Error with Shortcode [closed]