Questions tagged [wp-list-comments]

Displays comments, for a post of a post type that supports comments, based on a variety of parameters including ones set in the administration area.

6
votes
1answer
3k 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 ...
5
votes
2answers
3k views

Comment Walker vs. Comment Callback

I've been messing around with custom comments this week and I'm trying to figure out when I'd want to use a walker and when I'd use a callback... There's some things I can't quite figure out how to ...
4
votes
1answer
82 views

How can I see all of a post's comments on a single page as a reader, if pagination is enabled?

Is there an URL I can access, or an argument that can be passed, to disable pagination on the reader's side? The blog uses standard Wordpress comment pagination, i.e., http://example.com/2012/01/post-...
3
votes
1answer
594 views

Why does comment_reply_link launch the reply form at the wrong spot on the comment section?

I have this custom extended Walker_Comments class: class Custom_Comment_Walker extends Walker_Comment { var $tree_type = 'comment'; var $db_fields = array( 'parent' => 'comment_parent', '...
2
votes
1answer
9k views

Change HTML Produced by wp_list_comments()

I am developing a WordPress theme for which I would like each comment's timestamp wrapped in in a <span> element for the sake of styling it with CSS rules. However, the wp_list_comments() ...
2
votes
1answer
699 views

Exclude post_type from admin comments_list

I'm trying not to show comments from a certain custom post type int the comments list on the admin interface. I went to the "wp-admin/includes/class-wp-comments-list-table.php" and tried to play with ...
2
votes
1answer
3k views

comment_reply_link() not showing up

In functions.php I enqueue comment-reply and also define a callback function for use with wp_list_comments(): function theme_queue_js(){ if ( ! is_admin() && ...
2
votes
1answer
2k views

Customize comment list markup

While creating a new theme, we'll have to customize the comment flow. For doing so there are two functions: wp_list_comments() and get_comments(). I am not very sure how to style the inner elements ...
2
votes
3answers
378 views

How to get last comments but not from admin (or other specific user role/capability)?

I'm using get_comments to show lastest comments i.e.: <?php global $comments, $comment; $comments = get_comments( array( 'number' => '5', 'status' => 'approve', 'post_status' => '...
2
votes
1answer
485 views

change the comment time output to: X time ago instead of actual date and time

<?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?> Above is the default code that exists for comments.php in the WP Core. This will produce an Output like this: ...
2
votes
1answer
1k 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 ...
2
votes
1answer
2k views

What is comment_karma?

While doing a var_dump on the $comment object, I see there is a comment_karma property. What is that?
2
votes
3answers
112 views

Is it possible to make wp insert last comment onto another page

If we set wp to break comments into pages after X nr of comments and we have X+1 comments , wp only shows that last comment instead of showing X and move the comment from bottom onto the next page. ...
2
votes
2answers
2k views

How to call wp_list_comments() with callback outside the loop

the template function as a callback argument of wp_list_comments function, and the template function takes three args:$comment, $args, $depth, like the template function that defined in the theme ...
1
vote
2answers
243 views

Limit comments displayed on basis of user_id

How can i limit comments displayed on the page - reviews by author_id. Lets say that the author_id to limit to is in variable $author_id_to_limit. Please tell me how to hook the function to do so. ...
1
vote
2answers
343 views

How to use a different database to list and manage comments in the backend

I need to make Wordpress use another database (not the one specified in wp-config site-wide) on the "Comments" admin backend. I then must be able to edit, approve, delete etc. comments as usual. The ...
1
vote
1answer
264 views

Compact pingback list with favicons

On a blog with pingbacks and trackbacks (pings) enabled I want to show just a link with link text and a favicon of the external site in a compact list: no date, no text. How can I do that?
1
vote
1answer
20 views

Check if comment was modified

Is there a way to check if a comment was modified so I can display a modified/edited tag? I can't seem to find anything anywhere or anyone asking about this. Also it doesn't look like the modified ...
1
vote
1answer
2k views

Passing arguments to wp_list_comments callback function

One can customize single comment markup using the callback argument in wp_list_comments like this: $args = array( 'callback' => 'my_callback', 'avatar_size' => 48, 'type' => 'comment' ); ...
1
vote
2answers
493 views

Can wp_list_comments output into variable?

Is there any way how to output wp_list_comments() into a variable? Something like $output = wp_list_comments(array('reverse_top_level' => false ), $comments); I am writing a plugin and it would ...
1
vote
1answer
1k views

Load comments.php template outside the post loop

I'm loading a post via ajax and outputting using $post = get_post( $post_ID ); Is there a way to load the comments.php template after I've output my post? I tried using: global $withcomments; $...
1
vote
2answers
3k views

How to load javascript file on homepage in Wordpress in order?

I am using a quicktags plugin, which was not loading on the home page, now it does, but it does it on the wrong place. How can I solve this? I want the quicktags.min.js file to load first, rather ...
1
vote
1answer
25 views

Diplay comment date on WP_Post_Comments_List_Table

I am trying to display each comment date on the comments list table on the post edit screen. Currently it only displays the Author name, IP address and comment content. https://developer.wordpress....
1
vote
1answer
531 views

Custom WP Comments Query with Nested Comments Possible? (Hierarchy/Depth)

I've set up a custom WP Comments Query that serves approved comments on posts ordered by date (basic stuff) and everything works fine except the fact that comments are displayed below each other and I'...
1
vote
2answers
86 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 ...
1
vote
1answer
314 views

$reverse_top_level works the opposite way according to Codex?

The Codex for wp_list_comments states $reverse_top_level (boolean) (optional) Setting this to true will display the most recent comment first then going back in order. For my it is actually the ...
1
vote
1answer
1k views

ol children instead of ul children

I've created a new walker class to display a custom layout when using the wp_list_comments(); function and this is perfect, the only thing is that all replies to one comment are listed in a <ul> ...
1
vote
1answer
2k views

customizing TwentyEleven comments template

Typically I don't utilize comments on my sites, however I'm using the comments functionality as a sort of live-feed testimonials page. To do this, I've borrowed comments.php and the comments portion ...
1
vote
2answers
4k views

How to call wp_list_comments() outside of the comments template?

I'm simply typing wp_list_comments() in page.php but nothing is shown. But if I put the comments_template() tag there, then the comment form, comments and pings are shown. Why is that, why can't I use ...
1
vote
1answer
55 views

How do I create comment-reply-button using <span> element not <a>

I'm currently working to design my first WordPress blog and I got stuck when I came to code comment-reply-button because I want the comment-reply-button to be coded in span element only not a element ...
1
vote
0answers
54 views

Can't show most recent comment on top with wp_list_comments() for WooCommerce reviews

I am trying to break my comments (reviews) on my single product page into various pages, having the latest comments displayed on top of each pages and the latest comments displayed on the first page / ...
1
vote
1answer
269 views

How to get comment id in callback function?

I am trying to get the comment ID in the custom callback function that I can use in wp-list_comments. Any help on how to do this? Thanks in advance I am using wp_list_comments as: ...
1
vote
0answers
851 views

Display date and time in comments

I use wp_list_comments(); to display a list of comment in WordPress. But it does show the format characters instead of the correct datetime. How can I fix this bug? Thank you.
1
vote
0answers
242 views

wp_list_comments renders incorrectly nested <ul>

I'm trying to figure out how wp_list_comments works. So I made the simplest possible callback just to see the structure of the result: function custom_comments_callback( $comment, $args, $depth ) { ...
1
vote
1answer
88 views

Customizing Comments on Posts

I have implemented custom code for generating comments on post page using callback function in functions.php. function MYTHEME_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?&...
0
votes
2answers
442 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
249 views

How to stop ultimate members to redirect comment authors to user profile?

I'm having a problem with the Ultimate Member plugin. The comments author links get redirected to the user profile. I need the basic WP feature- pointing to author URL/website. The plugin is ...
0
votes
1answer
4k views

Enable nested comments in Theme

I am trying to enable nested comments in my theme. I am new to all this stuff but I am doing my best. This is the code that I have in my comments.php <?php if ( get_comment_pages_count() > 1 &...
0
votes
1answer
2k views

show list of latest comments for each post in a loop

I want to show the last 5 comments for each post on my index page loop of posts. What Im using now is only showing the same comments for every post. How should I set this up and how can I add an ...
0
votes
2answers
37 views

Make user's name display as the site name in comments if it matches certain roles

So here's what I'm trying to do. I'm working on a plugin and I want to check each comment and see if the author of that comment has a role of "administrator" or "editor". If they do, rather than ...
0
votes
1answer
428 views

Remove the function which adds nofollow to links in comments

Not sure where the function is that does this but i need to remove it so all links in comments do not contain the rel="nofollow" attribute. I know i can use the comment_text filter to remove nofollow ...
0
votes
1answer
690 views

How to get comments other than using wp_list_comments?

I'm sure you guys are wondering, "why the hell?" - basically it is because it does not work with a plugin by NextSCRIPTS that pulls comments from facebook. When I'm in the admin panel I see the ...
0
votes
1answer
57 views

Same comments on all posts

I am working on a self-made theme and I have an issue where all of the comments are showing up on all the posts, instead of each post only showing their own comments. I am using this code to display ...
0
votes
1answer
96 views

Custom comment link

How can I customize my comment link without modifying comment-template.php file line 676: $link = $link . '#comment-' . $comment->comment_ID; I would like to get the same link just little ...
0
votes
1answer
73 views

Where are comments coded when using custom theme?

I am having issues displaying both the default comment system and a plugin comment system in Wordpress. Comments are enabled via Wordpress settings, comments are being made somehow via spam bots, but ...
0
votes
1answer
187 views

How to get the number of pages when paginating comments?

I want to display threaded comments via ajax using pagination. If I use this code to display comments for page 1 how can I know if there is something more to be displayed on page 2? If there is ...
0
votes
1answer
4k 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. ...
0
votes
1answer
818 views

How to get particular data from wp_list_comments outside the loop?

I need some help,very much new to wordpress. I need only comment title and comment date from wp_list_comments function in my post, calling from outside loop, after declared $postid as global variable....
0
votes
4answers
2k views

Embedding Youtube video on comments

In my posts, you can embed a video of Youtube by adding the link to the post. You don't have to do anything beside that. On my comments, I can't do the same thing. Is it possible to embed Youtube ...
0
votes
2answers
854 views

<?php wp_list_comments(); ?> is it possible to have the full code instead in the comments.php page

I strongly need to edit some parts of the comments left by the users, I want to add a link to the commenter's author.php page if he/she is a registered user by placing a text link somewhere next to ...