0
votes
0answers
58 views

Comments orderby comment date not working

I have a template to get the comment replies to a user and display it on a static page. It works reasonably well in so far as the correct comments are displayed but whatever I try I can't get the ...
1
vote
1answer
117 views

using wp_query to return posts w/ comment count > 0

I've looked at numerous examples of wp_query and can't figure this out. If the thing I was comparing were a meta value then I could to a meta query, but apparently you can't do a compare with a ...
1
vote
1answer
194 views

Most commented last 24h, week, month, year and all time - posts_where

I've removed my old post here, as the posts_where method is outdated. Thanks to kaiser, this is now how easy it is to list most commented posts within a certain time span: <?php $popular = new ...
0
votes
1answer
153 views

How to get most recent commented post above new submitted post in Wordpress?

I have this function: $ids = $wpdb->get_col("SELECT DISTINCT comment_post_ID FROM $wpdb->comments ORDER BY comment_date DESC LIMIT 0 , 30"); foreach ($ids as $id) { $post = &get_post( ...
0
votes
2answers
148 views

How to output comments number of a post per day?

I have a question about the comment numbers in a post... For now, I can output the total number of a comment inside a post outside the loop. That's cool enough, but I want to get show the comment ...
0
votes
1answer
127 views

wp_query select if have comments

I previously asked and accepted a similar question here: wp_query and comment_parent - select only posts with top level comments So I'm trying to use wp_query to select only posts that have comments. ...
0
votes
1answer
175 views

wp_query and comment_parent - select only posts with top level comments

I have a custom post type of 'films', and I'm creating a number of search filters using wp_query. All are working fine, but I now need to add in an option of exclude results that dont have any top ...
1
vote
1answer
63 views

How to list posts with disabled/closed comments, with pagination?

i'm interested how to display all posts (from all categories) that have closed/disabled comments? I have tried using the comments_open() function inside the loop, that works, i don't know how to ...
1
vote
0answers
62 views

Display posts with comments closed, with pagination?

i'm using a custom query, which needs to display all posts with closed comments. I have this <?php $the_query = new WP_Query('showposts=-1'); ?> <?php while ($the_query -> have_posts()) ...
0
votes
1answer
304 views

How to display comments list by order when clicking on newest or oldest link?

0 down vote favorite I have a wordpress single post where I have comment system - Live Site And I have two links one is: 1. newest 2. oldest The thing I want is when I will click on newest it will ...
3
votes
2answers
168 views

How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

I added the following to my functions.php: add_action('pre_get_posts', 'keyl_get_emp_posts'); function keyl_get_emp_posts($query) { if ($query->is_main_query()) ...
1
vote
1answer
457 views

Sorting posts DESC based on the number of comments using WP_Query

I have this unusual requirement from my client that I need to accommodate. They want to be able to view the posts with the largest number of comments first. At first I thought using a custom select ...
1
vote
1answer
338 views

Fastest way to get the comment and ping total count for a post

I'm making my own comment template (like this) and I need to know how can I get the comment and ping count for the current post, maybe using a fast database query or something like that? Note that I ...
1
vote
1answer
188 views

Prevent WordPress from loading comments

I'm displaying the comments for a post my way, using $comm = get_comments() and then passing $comm to wp_list_comments() (this is the reason why). How to disable WordPress from loading comments from ...
0
votes
2answers
521 views

How modify the comment content persistently based on $wp_query?

For a plugin, I need to build my own very early post content and comment content filter. Post content/text changing works, i.e. the modifications end up in the client's browser. But my comment ...
6
votes
2answers
4k views

Getting Post Comments for post ID using WP_Query() and a Custom Loop?

(Moderator's note: The original title was "Is there a way to get post comments by post ID on a custom loop using WP-Query()?") Hi! I'm running a custom loop using WP_Query, that only displays one ...