The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
14 views

Admin comment always on top of comment list / nested replies - possible?

I'd really just like a push in the right direction for this.. using a callback for a custom comment display so I can have 4 different forms of code and styles for: normal 'parent' comment normal ...
0
votes
1answer
30 views

Exclude specific user_id from args in get_comments

I'm basically using a 'latest comments' system on multiple pages where one specific user is listed as the first reply for a comment - highlighted with special CSS - and then 2-3 normal users below ...
0
votes
1answer
11 views

Problem displaying replies as part of author's latest comments on author page

I've based a lot of my method on this thread here I can currently display 5 latest comments on an author template page. I want to display the latest 3 replies from any user for each 'main' comment ...
0
votes
1answer
37 views

get only one last comment from each post

Lets say I have 5 posts where most recent comments placed. How can I get one comment per each of these posts? I want to use get_comments(). Is it possible? Post1: Comment 1 Comment 6 Post2: ...
1
vote
1answer
22 views

Commenter should see only his comments in wordpress

I'm building a site for a research and my participants will be all logged in to use the site. I would like to make these participants able to see only their own comments, so other users' comments will ...
0
votes
1answer
51 views

get_comments not working on custom post types

I am trying to get all the comments of the logged in user in the "foods" CPT but I'm still with no success. Here's my code: <?php $args = array( 'user_id' => $user->ID, ...
0
votes
2answers
26 views

Is there a better way to check for a new comment?

I have some code that runs on the client that checks every 30 seconds or so for new comments, and if a new comment is found the user is alerted. The check count the comments on a page, and returns ...
0
votes
1answer
78 views

get_comments not working consistantly with post_id

I am trying to get comments from another post. I am getting the post_id and doing a check to see if it has comments I can get the comments for the current post every time but for the other post I am ...
0
votes
1answer
122 views

Custom Nested Wordpress Comments with avatar

I am developing a theme and has no idea how wordpress handles the comment outputs. I have wp_list_comments in my comments.php, but I'm not sure how to customize the output to get the desired output ...
0
votes
1answer
83 views

How to get comment_ID by post_ID in wordpress

I used get_comment() but its parameter is $comment_ID which I has to enter manually for previous comments from wp_comments instead of that I need to get current comment means last updated comment ...
0
votes
1answer
45 views

Adding Parameters to get_comment

I have a code like this: <?php $comments = get_comments( 'post_id=' . $post->ID ); echo get_comment_author($comments[0]->comment_ID); ?> <br /> <?php $comments = get_comments( ...
1
vote
1answer
230 views

How to limit users to one comment per post

I am using WordPress as a petition site and hacking the comments system to work as the petition signup. I would like to find out how I can limit a user to post only one comment per post. So far I can ...
0
votes
0answers
11 views

Count comments + last pub date for subcategories

How do I get the comment count for a subcategory in this loop? So every child category of 225 had comments. That amount I want to list per child. Tried some stuff with get_comments, but unsuccessful ...
0
votes
0answers
41 views

My WordPress comments appear repeated even though it is not

My WordPress comments appear repeated even though it is not. It get repeated n times as comment exists. Here is my comment.php code: <?php function my_comments_callback( $comment, $args, $depth ...
0
votes
0answers
97 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 ...
0
votes
1answer
29 views

How can I grab and show the reader comments of my site

How can I grab and show the reader comments of my news site in a different page? Suppose, I have comments on a news site, into my posts. I want to show the comments (only the comments) into a ...
0
votes
1answer
935 views

How does “Your comment is awaiting moderation” work?

The question here is if someone could help me to make the comment "Your comment is awaiting moderation" work correctly for custom page. It works ok for standard Wordpress page but not for my own page. ...
2
votes
1answer
253 views

Comment `Reply` link doesn't work if comments are loaded from ajax

I am writing a plugin that displays custom home page that is in fact only one post with comments. The first time home page is displayed by the initial call by php. Then user can click a menu button to ...
0
votes
1answer
65 views

Inserting a random number into an array [closed]

So what im trying to do is make a random offset for 'top comment', at the moment it's working great(with no offset) but I want to randomise the offset so it displays 1 of the top 5 comments by ...
0
votes
1answer
62 views

Change Wordpress comments url / word

Is this possible? For example, I want to change http://mysitesitesite.com/post-name/comment-page-1/#comment-452 to http://mysitesitesite.com/post-name/custonname-1/#customname-452 What should I ...
0
votes
2answers
85 views

How to get posts and comments amount per hour, per year and per month?

I have this snippet: function count_user_comments_today( $uid ){ global $wpdb; $today = date('Y-m-d'); $tomorrow = date('Y-m-d', time() + 86400); $count = $wpdb->get_var( ...
0
votes
2answers
196 views

Get first comment link on the post itself

I have this function and a link to a post: <?php foreach ($results as $id) { $post = &get_post( $id->ID ); setup_postdata($post); <li><a <?php href="<?php ...
0
votes
0answers
62 views

Get url/link to latest comments in a post

I have a post list in WordPress where people can see the most recently commented posts. They will appear above the list. That's fine, but now, I have 300 comments on the same posts and I don't want ...
0
votes
2answers
966 views

Getting comment count per post not working

I have this function: <?php $popular = new WP_Query('orderby=comment_count&posts_per_page=5'); ?> <?php while ($popular->have_posts()) : $popular->the_post(); ?> ...
0
votes
1answer
68 views

How to get recent comment link

I'm getting 5 recent comments into my sidebar using the following code: <?php $recent_comments = get_comments('status=approve&number=5'); ?> <?php foreach ($recent_comments as $comment) ...
0
votes
1answer
40 views

Author page link in comments is different than in posts?

When I hover over the comment author link on my comments, it shows a link like http://mysitenameeeee.com/?author=24 After I click it, it gets me to /author/authorname, which is fine, but I don't want ...
0
votes
1answer
205 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
1answer
166 views

Get comments only for certain specific users in template file

To return comments for a specific user, I use the code below: $arg = array('user_id' => $userID); $coms= get_comments( $arg ); How can I modify the arguments of this function so that I get ...
0
votes
3answers
116 views

Show comment number per author per day

Is this possible? I've never seen it used, but I need it... I want to show for each author (if they are logged in) on their own profile page, the amount of comments they have posted today. If the day ...
2
votes
1answer
353 views

Can't show comments count per post outside loop

How can I show the amount of a comment per post outside the loop? I tried this in a function already: ' . get_comments_number . ' , but that outputted the text "array" on the screen... What do I have ...
1
vote
0answers
93 views

Loading Multiple Comments Pages via Ajax?

I have been searching Google and still haven't found any great ideas for making comments pages load via Ajax. After searching SE I found this older thread from just a few months ago which provides a ...
1
vote
1answer
189 views

Display User Role Next To Comment

I've search around but I can't seem to find exactly what I'm looking for and for the first time I don't even know where to start. How do I display the user role (Admin, Editor, Author Contributor, ...
2
votes
1answer
333 views

get recent comments of a particular category

I am using get_comments('status=approve&number=5') to display recent comments in my wordpress sidebar. I need to display the recent comments of a particular category. How to do this?
0
votes
2answers
384 views

Show count of all comments by meta_value from a users posts

I'm trying to display the total number of comments for a users posts limited to a comment meta. I've tried using both get_comments() and WP_Comment_Query() but I get the same result of "1" for the ...
1
vote
2answers
509 views

get_comments_number of depth-1 (Level 1) (1 post)

I selected only 2 levels of comment for my wordpress site. How can I display the number of comment of the first level ? (Depth-1)
1
vote
1answer
358 views

get_comments() where parent is not 0

I need a way to get just the comments that aren't top level i.e. where parent is not 0. I've tried: $args = array( 'parent' => -0 ); $comments = get_comments($args); I know the parent ...
0
votes
1answer
777 views

paginate_comments_links() not working

I'm using paginate_comments_links() to get all the comments by the current user: <?php global $current_user; get_currentuserinfo(); $userid = $current_user->ID; $args = array( 'user_id' ...
0
votes
1answer
435 views

Get the latest comment from a custom post type where depth = 1?

Happy new year everyone. I've been struggling with this one for a while. I need to get the latest comment from a custom post type, but ignore any child comments i.e. only look at comments with a ...
3
votes
2answers
305 views

How to get comments with mixed status using get_comments?

Is there a way to get comments with more than one status using get_comments function? Let's say I would like to get both trash and hold comments. It is possible to do the same with posts: ...
1
vote
2answers
219 views

Get only one comment per post with get_comments

Is there a way to limit get_comments results to just the latest comment from every post?
1
vote
1answer
33 views

Comment number does not increment

I am making a custom wordpress theme and when I add a comment to a post and retrieve the number of comments using get_comments_number() the number does not change. I do know the function works ...
1
vote
2answers
635 views

Load comments per post on click with AJAX

I'm working on a theme that uses a slider to display blog posts. Beneath the slider is a pagination that displays like a timeline, with a date instead of a page number, calling the corresponding blog ...
4
votes
1answer
709 views

Aggregate comments, with pagination

I want to build a page that would display all comments, regardless of which post they're attached to. I also want that page to be paginated, since it'll potentially have 10,000+ comments. I'm not ...
2
votes
1answer
350 views

Display number of comment replies

I want to show the 3 most recent comments and have a small div underneath that shows how many replies each comment has (count how many comments where comment_parent => comment_ID). I do this by ...
4
votes
2answers
625 views

Get comments for more than one post

I would like to get all the comments for a group of post (not only one post. I tried $comment_args = array('number' => '14', 'post_id' => '10,20,30,40' ); $comments = ...
0
votes
2answers
371 views

Get comments after specific date

I don't think this is a parameter in get_comments( $args ); so I'm using a SQL statement. First I obtain a comment date from a separate table I created. Afterwards, I want to retrieve all comments ...
0
votes
1answer
1k views

Display of comment_date within get_comments?

Any way to change how the date is displayed with get_comments..? I have the following.. <?php $comments = get_comments( array( 'post_id' => $post->ID, 'number' => ...
1
vote
1answer
158 views

Get comments from post and sort by commentmeta value

I want to get all of the comments for a given post and return them in order by a meta_key's value desc high to low. Doesnt look like i can do this with get_comments() like i would like to. This will ...
1
vote
1answer
1k views

Query & Sort Comments by custom comment meta

I added a basic "favorite/recommend" functionality for posts and comments to a wordpress site I'm working on. I'm storing the total numbers of comment "likes" in a custom comment meta field ...
0
votes
1answer
162 views

Where to insert get_comments?

I'm trying to setup a page and extract comments from an external post. I took this advice how to pull wordpress post comments to a external page and now I have this get_comments code at my disposal: ...