Articles of get comments

Display latest comments on page with pagination

Im trying to display latest comments from all the post on a page named comments, now im able to use <?php wp_list_comments(‘per_page=25’, get_comments()) ?> and it gets all the comments but when I try to use <?php get_paginate_comments_links() ?> nothing shows even the next and previous buttons dont show, what am i doing wrong? This […]

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 comment id’s (44 and 48) of all the comments I require, so I tried: $args = array( ‘parent’ => array(44,48) […]

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( $id ); setup_postdata($post); ?> <p><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></p> <?php } ?> Which shows the latest commented posts in a […]

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?

How to check for specific content in comments in the loop

I’m using the following conditional code to check if any comments on a given post contains a certain string. -The word ‘CHANGES’ in this case. I have it working if I specify the comment_ID directly, but I’d like to have the code use the loop to check all the comments for a given post and […]

Show last n comments

let’s say I have posts with hundreds of comments, and that I want to show only the last N comments and then a link to a page read them all. How would I display the last N comments? Thank you, Dino.

Threaded Comments Feature not working

If a reader posts a comment on my blog, I’m able to reply to it. But the reply is not appearing on the post page, even after approving the comment. Number of comments to that specific post is 3, i.e., 2 from Readers + 1 Mine(Reply). Here is the example: . Note: I have […]

Making shortcode of filtered number of comments by user role

function comments_shortcode($atts) { $current_user = wp_get_current_user(); . . . extract( shortcode_atts( array( ‘id’ => ” ), $atts ) ); $num = 0; $post_id = $id; $queried_post = get_post($post_id); $cc = $queried_post->comment_count; if( $cc == $num || $cc > 1 ) : $cc = $cc.’ Comments’; else : $cc = $cc.’ Comment’; endif; $permalink = get_permalink($post_id); […]

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 looping through each parent comment (comment_parent => 0) and then for each parent comment, use get_comments(comment_parent => $comment_ID). Unfortunately the […]

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?