Stack Exchange Network

Stack Exchange network consists of 174 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

The tag has no usage guidance.

0
votes
1answer
16 views

I want to change the Wordpress comments file

In the standard structure of Wordpress, a warning page appears when the user makes spam or goes too fast. The link structure of the warning page is "/wp-comments-post.php". Briefly (see images) https:/...
0
votes
1answer
18 views

The comment could not be saved. No comment_ID on comments

Every time I try posting a comment logged in as an admin, I get the following message: [ERROR: The comment could not be saved. Please try again later.] But when I actually go to the database, I find ...
0
votes
1answer
18 views

How to display comment meta under each comment content

I'm trying to display comment meta under each comment, but I couldn't find which action should I hook in.
0
votes
0answers
11 views

Same comment template for different post

I'm creating a news aggregator website where lot of posts are generated from different publisher. I'm really having a problem where the same story has a different title and post and as a result ...
1
vote
1answer
22 views

Is it possible to force login for comments only on custom-post-type or the custom comment template?

I use a custom page template review-template for my custom post type reviews. And on my template, I use a custom comment form review-comments. Now... How do I enable login only for my review-comments ...
0
votes
0answers
61 views

Reply to comments and nested comments

i'm crating my first wordpress theme, and i'm dealing with the functionality of the comments, I don't really know how to make the replies work on a nested comment. This is what i have so far on my ...
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 ...
0
votes
0answers
32 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 ...
0
votes
1answer
27 views

Comment function for page

I'm trying to include my comments.php on a page and my custom comment function isn't returning any result (works on posts). Please help me sort this. I want to be able to create a ACF block to ...
3
votes
1answer
311 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', '...
3
votes
1answer
88 views

What does the “$depth” parameter in the Walker_Comment stand for?

I'm trying to write a custom comment class for my comments and I've been trying to de-construct the code for quite a while, here it is: class Custom_Comment_Walker extends Walker_Comment { var $...
0
votes
1answer
15 views

How to call out the date of user's first comment?

For example, Sam's first comment was posted in 2010. How can I show this next to his name in the comment section? Like this: SAM [Joined since 2010] Update: Sorry for the unclear question. I am ...
1
vote
1answer
117 views

Change the HTML of the comment form that is generating somewhere from the core Wordpress

The above is a snapshot where some classes and HTML arrangements(some flex and flexbox arrangements are needed) are generated by the WordPress → <cite class="fn"></cite> <span class="...
0
votes
1answer
37 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
1answer
252 views

Customizing comments pagination for bootstrap

I want to customize the comments pagination to support Bootstrap, I have these lines in my theme file but I need more customization to display Bootstrap pagination style <?php ...
0
votes
1answer
87 views

Check if the current user is author of first comment

I am editing the comments.php file for the purpose of my site. I want the comment section to be something like this: only the person who made the first comment and the post author will be able to ...
0
votes
1answer
188 views

How to pass settings to comment_form() if theme only uses comments_template()?

I have a theme which uses comments_template() to write a comment form and existing comments to a page. It appears that comments_template() calls comment_form() internally which writes the form that ...
1
vote
0answers
177 views

Modify Wordpress Comment From For AMP Html

Im using a custom filter to change the fields, but can´t figure out how to change the order of the fields in the comment form. Could you please how to modify this WordPress comment From <form ...
0
votes
1answer
175 views

How to get related posts and wp comments under tabs

I am a novice and want to show two tabs under every wordpress post. Under the first tab there would be related posts and under the second tab there would be wp comments. So The default comment area ...
0
votes
1answer
454 views

How to add a class to comment submit button?

I have tried adding using the 'class_submit' in the array, but that wraps the button in that class, making it clickable only on the button link. I want the whole button to be clickable. I also tried ...
1
vote
1answer
5k views

customize comment form

I want to change the titles "Name", "Email", and "Website" in my comment form?. How could I do this? I thought by changing them in this field would work ( 'Website', 'domainreference' ) but it doesn'...
0
votes
1answer
527 views

Override comments.php template with plugin

How can I override default theme/WP Core comments.php template with my own in the plugin? I searched for different solutions, but they don't work for me. Or how to hook to the end of any post (even ...
0
votes
0answers
57 views

Display translated version of native comments.php for specific category

Wordpress displays translated version of the comments.php file automatically based on the site language. I'm developing a theme where the website has category in a different language than the rest ...
3
votes
2answers
521 views

Showing comments only to same custom user role

Is there a way I could show only the comments by a particular user role to his same user role? For example: The logged in user belongs to the "Advertisers" user role, he should only see the comments ...
2
votes
2answers
600 views

how to get the comment ID in the front end when the REPLY button is clicked?

I think I might be able to parse the URL for the replytocom parameter and get the comment ID from that. However, it would mean that my plugin would not be fully compatible with other plugins that can ...
0
votes
1answer
78 views

How can I return the result of my custom function?

I have used the following source code to add an extra city field to my WordPress comment form: <?php /* Plugin Name: Comment meta data test Version: 1.0 Plugin URI: http://wpengineer.com ...
6
votes
2answers
3k views

How to wrap submit button of comment form with div

Is there a way to wrap the submit button with html element while using wordpress function comment_form function. $comments_args = array( 'id_form' => 'main-contact-form', ...
2
votes
1answer
100 views

Order of Operation for these three hooks

What is the order of firing for these three hooks? add_filter( 'comments_array', array( $this, 'BuildCommentsArray' ), 10, 2 ); add_action( 'preprocess_comment', array( $this, 'write' ), 10, ...
0
votes
1answer
64 views

Change the “Allow comments” text for admin edit screen for custom post type?

I have a custom post type that uses an alternative comments template. I modified the comments template for my custom post type to function like a five star review system. Is there a way I can change ...
0
votes
2answers
127 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 ...
0
votes
2answers
230 views

How can I embed comments plugin to my own website?

I am looking for a way to embed WordPress comment form to watch.php in order to allow user to comment on a specific video. Can you tell me how?
2
votes
1answer
7k 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() ...
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
88 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 ...
0
votes
3answers
1k views

Custom comment field not showing when logged-in

I've added a custom field in comment by using function comment_label($fields){ unset( $fields['url'] ); $fields['rate'] = '<p class="comment_form_rate" id="rate_recipe"> ...
1
vote
1answer
1k 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
0answers
949 views

Create Custom Comment Type

I have a page when I want multiple comment_template, so I want each of my comment_template to have different type so I see different comments in those 2. My get_comments look like this $args = ...
0
votes
1answer
85 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
73 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? ...
0
votes
1answer
141 views

reply to comment excerpt instead of author in comment title

One can reply to a comment using Reply link, below each comment item in comments list. According to codex, by clicking that link and using comment_form_title function like this: $replytext = 'Leave ...
1
vote
1answer
779 views

comment_post action hook running on page load instead of after a comment is posted

I am trying to call a function after a comment is saved to the database, see below... add_action('comment_post', 'myFunction', 10, 2); do_action('comment_post', $comment_ID, $comment_approved); I ...
1
vote
1answer
366 views

Add classname comment template from functions.php

I want to add an extra classname to my comment template (the div wrapper before the post itself) which is stated in functions.php. The classname in functions.php is an extra field in my users profile ...
1
vote
1answer
277 views

How to reorganize the items returned by wp_list_comments()?

I'm new to WordPress theme development and learning by building a new theme of my own. I want to reorganize the items returned by wp_list_comments(). I created comments.php in my theme folder and it ...
0
votes
1answer
34 views

Redirect first time comments

So I want to add a comment redirect code to my comment form. I know I have this part right here: <input name="redirect_to" type="hidden" value="http://domain.com/thank-you" /> So what I want ...
0
votes
1answer
83 views

How to edit label_submit styling?

This is going to sound like an easy fix, but I am looking to style my submit comment button on my comment form. Currently the code in the $args = array looks like this: 'label_submit' => ...
2
votes
1answer
2k views

Warning: call_user_func_array() expects parameter 1 to be a valid callback, func

I have installed Wordpress in my localhost server. I am a creating custom menu. When I try to remove the existing "primary" menu from it, I get this error Warning: call_user_func_array() expects ...
0
votes
1answer
154 views

Increase Comment Author Gravatar Size On WordPress Default Comment Function

I am new to WordPress theme development. I am designing a new theme and using less codes and file as I am starting from basic. I am adding comments and comment form in my single.php using <?php ...
0
votes
1answer
136 views

How can I fix the even/odd child classes comments so that the comments are unaffected by the top-level even/odd?

Sorry if the title was confusing, I'm having a bit of trouble explaining here. I'm working on a theme for my site, and I'm using a slightly modified version of a custom comments template found here. ...
1
vote
3answers
289 views

How to change commenter links to /user/user_id?

I would like to change the commenter links as shown in this screenshot: In my test plugin at GitHub I have first tried the following code: define('PROFILE', '<a href="/user/%s" rel="external ...
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 &...