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-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.

0
votes
0answers
14 views

Customize wp_list_comments() function to show part of the comment and put show more

Team. I have a comment section, some of the comments are long. Is there a way to customize the comment to show only 20 words and have a continue button to show the whole comment.
0
votes
0answers
49 views

WordPress Comments sort by custom meta key

I want to sort comments by a number of likes which is saved as a meta_key in the wp_commentmeta table: I have tried two ways but it doesn't sort the comments by most liked comment at the top. Please ...
0
votes
1answer
507 views

Posting a comment redirects admin/users to blank page

I have looked a lot on this problem on forums and tried out a few of the solutions but nothing seems to work for me. When I try to comment here: http://www.chicitout.co.nf/crochet-lace-skater-dress/ ...
0
votes
1answer
651 views

How to get the 5 most recent comments and each comment 5 most recent replies (children)

I want to get the 5 most recent comments and each comment's 5 most recent replies (children) in descending order. With the following code I can get the 5 most recents comments but it won't distinguish ...
2
votes
1answer
8k 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() ...
1
vote
1answer
53 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 ...
0
votes
1answer
2k 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 ...
1
vote
0answers
42 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 / ...
0
votes
1answer
227 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
0answers
32 views

How to show comment author URL next to comment author?

By default, the comment author links to their URL. But I have changed that to their profile. Front-end profile generated by a plugin. Now when anyone clicks on author name they are redirected to the ...
0
votes
0answers
42 views

How to add delete, approve, spam Links to Comments

I am developing a plugin where I list all the available comments and then I want to have a links like Delete, Approve, Unapprove or Spam etc. I have followed a thread here: Add delete, approve, spam ...
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
1answer
47 views

Disable Wordpress Comment Author Name

I am using the Wordpress theme Switty and was wondering how to entirely disable the comments section's poster. I need to create a member-only, anonymous comments section and am using Wishlist Member ...
1
vote
1answer
19 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
24 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....
0
votes
0answers
38 views

change level of ul children in comment

The actual structure of my comments is in shape <ol> <li> <ul class='children'> <li></li> <li></li> <li> <ul ...
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?
1
vote
2answers
82 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 ...
3
votes
1answer
476 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', '...
0
votes
4answers
710 views

Comment as post - understanding wp_list_comments

I'm creating a site where a central question will be posed on the front page with excerpted first-tier comments linking to a page with the full first-tier comment, presented almost as a post, with ...
0
votes
1answer
1k 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
1answer
435 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: ...
0
votes
2answers
36 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
42 views

Removing(replacing) avtar in comments.php with some other HTML arrangements

<ol class="comment-list"> <?php wp_list_comments( array( 'style' => 'ol', 'short_ping' => true, ...
0
votes
2answers
134 views

wp_list_comments() only returns when user is loged in

<?php if (!is_user_logged_in()) { ?> <p class="text-center"> برای ارسال نظر باید <a href="https://www. .com/login?redirect_to=<?php echo the_permalink();?>"><i class="fa fa-...
0
votes
1answer
397 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
0answers
86 views

edit-comments.php comment_row_actions ajax problem

On the edit-comments.php page, I'm hooking into the comment_row_actions filter to add another link at the end. I'm copying the "Approve" link, adding another query key and value and modifying the ...
0
votes
1answer
170 views

Cannot display comment in page

I added some custom fields in comment, so i have a couple of more fields. from that form I can comment but am unable to display that comment. The comments are set to moderation so admin have to ...
1
vote
1answer
482 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'...
0
votes
1answer
89 views

Show comments based on user role in front end

I want to allow commenting on a custom post type by a specific user role. And a user can see only his comments only. Scenario is e.g User roles are student and instructor. The Student can comment on ...
0
votes
1answer
48 views

How modify comments metabox on post edit screen in Wordpress?

I search a solution for custom the comment's html on post edit screen when i click to the button "add new comment". I want to add a ACF field in the form. The codex not explain a solution... Or an ...
0
votes
1answer
211 views

standard callback function for wp_list_comments

I know that the code for the comment is generated in Walker_Comment::comment() and for html5 themes in the method Walker_Comment::html5_comment. But if I try to copy the code from that last method ...
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 ...
0
votes
1answer
49 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
0answers
40 views

How to create a designated comment page with custom fields

I'm creating a site where I want to use the comment box to auto-generate a FAQ page. In essence, when a comment is posted it won't appear on the same page as the comment box. Instead, it will be ...
3
votes
1answer
2k 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() && ...
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. ...
1
vote
2answers
477 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 ...
0
votes
2answers
135 views

How Can I display the Current Logged-In User's Comment at the Top of the Comments Section in Wordpress?

What I'm trying to do is show the current logged in user's comment at the top of the list in the comments section in Wordpress on any given post. I don't care if it is just duplicated at the top and ...
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 ...
0
votes
1answer
90 views

Paginated Comments “reply” does not work!

I use plugin Paginated Comments. I edit template and CSS in paginated-comments.php but "reply" does not work. "reply" does not appear at all. http://i.imgur.com/ieIeadO.jpg (There should be a button ...
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' ); ...
0
votes
1answer
92 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
0answers
76 views

Comments page id wp_list_comments

Under post i want to display last five comments. At next comment page or after click button "show more comments" I want to display all comments or set quantity comments to display. How can i do it? ...
1
vote
2answers
240 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. ...
2
votes
3answers
111 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. ...
0
votes
1answer
67 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 ...
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
257 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: ...
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 ...