Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wp-comment-query]

The tag has no usage guidance.

0
votes
0answers
13 views

Get Specific Product ID WooCommerce Comments

I am trying to place the WooCommerce comment fields but for an specific product id <?php global $withcomments; $withcomments = true; comments_template( '', true ); ?> And this custom field ...
3
votes
1answer
41 views

How would I count the number of times a comment meta field's value is in a post's entire comments?

How would I count (and display) the number of times a comment meta field's value is a post's entire comments? e.g. meta key is "fish" and key value "shark" appears in 5 comments of a post.
1
vote
1answer
168 views

How to query comments only for the current post?

I am using ACF and my comments have custom fields. I also have custom post type called cars. What I'm trying to do is to make users comment their average consumption, and then I calculate average ...
3
votes
1answer
381 views

WP_Comment_Query with 5 top level comments per page?

I'm trying to replicate the option in WordPress's settings page that says: [x] Break comments into pages with ((5)) top level comments per page and the ((first)) page displayed by default Right ...
4
votes
2answers
647 views

Custom WP_Comment_Query with pagination and orderby?

I'm trying to setup a custom WP_Comment_Query which is ordered by a meta key. (It might be worth mentioning that these comments are being retrieved with AJAX.) It all works fine, until I add in ...
5
votes
1answer
154 views

Exclude comments from a WP_Query object?

I have noticed that the default WP_Query object also contains all of a post's comments. global $wp_query; print_r($wp_query->comments); // Prints an object containing all of a post's comments ...
0
votes
3answers
3k views

Trying to get property of non-object notices in comment-template.php

I need some customization of WORDPRESS comment area, so I've used this code in my child theme : <div id="comments" class="x-comments-area"> <?php if ( have_comments() ) : ?> ...
1
vote
1answer
516 views

List user comments in author page

I'm trying to display a list of the author comments in the authors page but it only shows No comments made. How can I list user comments in the authors page? <?php $args = array( 'user_id' =&...
3
votes
1answer
116 views

WP_Comment_Query() displays “password protected” comments?

It appears that looping through wp_comment_query() with the argument post_status set to publish also lists comments that are posted on password protected posts. Is this the correct behavior or is ...