Questions tagged [comment-form]

This tag outputs a complete commenting form for use within a template. Most strings and form fields may be controlled through the $args array passed into the function, while you may also choose to use the comment_form_default_fields filter to modify the array of default fields if you'd just like to add a new one or remove a single field.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Update post “A” on comment submition on post “B”

Hello and thanks in advance for any help. Im trying to update the post status from a post when submiting a comment on other post, I have a variable in the url pointing to the ID of the post I want to ...
0
votes
1answer
13 views

Upload avatar for post comment

I have a comment form and any one can add comments without creating an account. Now client asking to allow user to upload profile picture from the comment form. Check attached image below. Any help ...
0
votes
0answers
8 views

Change title-reply when actually replying to someone in comment_form

Is there any way to change the comment form title when replying to someone's comment. For example, I set my comment form title to Leave a comment but when replying to someone's comment it needs to be ...
0
votes
1answer
29 views

How to display replies to his comments in user profile of current user

How to display list of replies to his comments in user profile of current user. my website can send notification that example: "someone replied to your comment" and when i click the link ...
0
votes
0answers
17 views

reply comment below the comment box without reload page

I make a comment form before comment list and I want to show a comment form inside the comment box that chose to reply without refresh the page the website I inspired the idea Novin.com
0
votes
1answer
34 views

How to display comments length

i used this code for limit comment length add_filter( 'preprocess_comment', 'wpb_preprocess_comment' ); function wpb_preprocess_comment($comment) { if ( strlen( $comment['comment_content'] ) >...
0
votes
1answer
25 views

Comment author profile image

I have a custom comment form and any one can add comments without creating an account. Now I want to set comment author image for each of the comment. I could not find any function or support for this ...
0
votes
1answer
14 views

Is there a way to edit the markup of comment_form()?

I have a single.php page where I call the the_content() function, followed by the comment_form() function to display the comment box. While this function does display the logged in user, link to log ...
0
votes
0answers
13 views

Customize comment form fields HTML

I cannot change HTML output of my comment form fields, but textarea works perfectly. function set_my_comment_title( $defaults ) { $defaults['comment_field'] = '<div class="form-group col-md-...
0
votes
0answers
13 views

Comment reply form doesn't move under comment when not logged in

I made a custom comments.php template for my own theme and almost finished it. The only thing left bugging me is that when i'm not logged in and click button to reply to a comment, the comment form ...
0
votes
0answers
9 views

Wordpress Comment Box On Custom Page

I want to show comment box on custom file, like when user click on link they will see only comment box without post or other content, i want something like this: if this is my post url : https://m....
1
vote
1answer
79 views

How to call my custom WordPress Comment form without getting the comments?

I just created a comments.php file inside my WordPress theme folder and I customized some fields. My main purpose was to use Bootstrap 4's input groups. When I call the comments using the code piece ...
0
votes
0answers
19 views

How to translate strings in comment form?

How to translate strings in comment form? I need to change string "Název" to "Jméno" and "Email" to "Emailová adresa". I didn't found this strings in .po files.
0
votes
0answers
7 views

how to make all comment in moderation, even admin and post author?

I need make wordpress CTP or post with comment in moderation, even admin and post author? try couple way but no luck. thanks
1
vote
1answer
22 views

Translation Issue with Wordpress Theme Check in comment_form function

I ended my wordpress theme, which called the_mdttheme. I tried to check it and get two errors with translation in comment_form(). Can't understand what did wrong, can someone help me? Here is two ...
0
votes
0answers
23 views

Unwanted extra text before comment form

As you can see in the image below there is a text: Name (required)E-mail (required)Website before the comment form which should not be there. I want to remove this text but I am not able to find ...
2
votes
2answers
124 views

How to save new comment as custom comment type?

My previous plugin was saving the comments as type="wp_review_comment". I have handled the previous custom fields as below. But I'm having difficulty saving the comments as a custom comment type. // ...
0
votes
0answers
24 views

Recounting all posts' comments

I moved back from Disqus to WordPress' built-in comment system. Unfortunately many of my posts display the wrong number of comments (many say 0 comments but that's wrong). This code works for PHP up ...
0
votes
0answers
33 views

How to find which last line executed in wordpress?

I got one of the sourcecode that having an issue with woocommerce comment. After wordpress comment it displays Array ( [rating] => 1 [comment] => Something happen [...
0
votes
1answer
38 views

Force to show all fields in comment forms to the logged-in users

I want to force to show all fields (if possible these can pre-filled with user own e-mail and name data) to the logged-in users. So I found a reply on Wordpress Development/SE Community but I don't ...
0
votes
1answer
15 views

Top rated posts Average rating issue

I am trying to show top rated posts, cpt with AVG rating value.I created the custom widget for this. Defaults wp posts data and AVG value is showing correct but a CPT like Movie post not showing ...
0
votes
0answers
16 views

wordpress reply comment doesnt work with comment form

I created custom wordpress comment area. I want users could reply comments with form below the comment section. when i click on reply button page refreshed and URL changed but after submit form, it ...
1
vote
0answers
17 views

Insert page comment form into a modal

Good day! How do I insert the comment form of a certain page into a modal? I have in my wordpress website the plugins Popup Maker and Buttonizer. Now I need the comment form to be inserted in the ...
0
votes
0answers
24 views

Create a feedback page

I have a floating button in my WordPress website that will popup a modal with a feedback form. If the submit button was is pressed, the feedback will be posted to a certain page (e.g. Feedback page). ...
0
votes
2answers
45 views

Hide review form if user has left a comment

I am trying to hide the comments form if a user has left a comment on that particular post, otherwise display the comment form. I added a code snippet to a hook which hides the form, but reverts to ...
0
votes
0answers
70 views

How to display error messages in the same page?

When I submit my comment_form, in case of an error the page redirects to wp-comments-post.php. Is there a way to prevent the page from redirecting and stay in the same page? I have been searching for ...
0
votes
0answers
29 views

Comment Form Fields when user logged in

WordPress comments form automatically detects the name and email if you logged in. I want to disable this feature by adding a code snippet. The name and email fields should be filled by users and even ...
0
votes
1answer
185 views

how to load the comment template from a plugin

I want to create custom design for the comments. comments_template() will load the default \comments.php. i have a file inside my plugin commentsnew.php how can i use this file for comments_template(...
0
votes
1answer
19 views

How do I check which comment fields are required in my theme?

I plan to use comment_form() with a bunch of arguments to format the output. However, I need to know which fields have been set to required (to style them as such). How do I do that?
0
votes
1answer
718 views

How to get top rated posts using wp query?

I want to get top rated posts using wp query. The rating value is store in comment meta database table when some one post a comment on wp post or cpt.Please screenshot EDIT Here is my code ...
0
votes
0answers
24 views

Store comment form custom field in custom database

I'm trying to add custom field created on comment form to custom database. But my solutions not working. How to change/improve it? I add custom fields this way: function add_interests( $fields ) { ...
0
votes
1answer
1k views

How to Send Confirmation Emails to Users after Form Submission?

I would like to run a confirmation e-mail on Contact Form 7 What I want is: Once a form has been submitted, the visitor who sent the form must confirm it by going to the email address. A confirmation ...
1
vote
0answers
25 views

Add a default WP comment form to forum template

I've learned that it is possible to add a default comment to the custom post type: https://codex.wordpress.org/Plugin_API/Filter_Reference/comments_template However, what if in case of not custom ...
1
vote
1answer
324 views

How to add a title field in comments?

Just like WP posts have title and text, I want to have titles to my comments. Now how do I add it and show them above the comment texts like a title. I need it to have a css name as well. The title ...
0
votes
0answers
15 views

How is it possible to create Multi part sections where people can answer or comment or vote on various parts of a page's content as given example?

How is it possible to create Multi part sections where people can answer or comment on various parts of a page's content as given example? Using this as a reference example (can attach screenshot if ...
1
vote
1answer
708 views

Remove “at” string from wordpress comment date

I'm using the following code to format the author's comment date and remove the time: function my_change_comment_date_format( $date, $date_format, $comment ) { return date( 'd M Y', strtotime( $...
1
vote
1answer
627 views

Global $post not working in OOP function WordPress

I added a custom field with comment form. Below is my code.First function return post id when using var_dump function.But the last function return NULL always. class Post_Rating_Public_Helper { ...
0
votes
0answers
428 views

How do I make comment-reply-button with <span> that takes to comment reply form on click

I do need your help. I'm actually designing my personal blog's theme and I got stuck when I could not code a working comment-reply-button with span element. I know you must be wondering why with a ...
0
votes
1answer
52 views

Author name length character limit?

In comments, I want to limit author names. For example, the author's name should be no more than 10 characters. I'm looking for a way to do this. Thank you very much in advance.
0
votes
1answer
84 views

Check if comment author has url

I wanted to add target=_blank to comment author link and also wanted to add redirection link to url. So here is what I did: <a href="site.com/go?url=<?php echo get_comment_author_url(); ?>" ...
1
vote
1answer
2k views

How to add consent checkbox in comment section

To fulfil the GDPR policy, I want to add a consent checkbox under the "Post Comment" section. I have followed the WpBeginner tutorial and put the following code in my Comment.php file // Now we will ...
0
votes
1answer
1k views

Comment form on custom page template

I have created a custom page template, but I don't know how to add the WordPress comment form to my <body> tag. I tried to include the following in my template.php file in the body tag, but the ...
1
vote
1answer
18 views

changing font size and font of a custom message added after comment

hi i have added a code in function file of the theme to show a default custom message after the user leaves a comment of the blogposts . it reads like this . add_filter('after_comment_text', '...
0
votes
1answer
48 views

How to make comment reply available only for login members of a certain user roles only?

I use the default public WordPress comment system. But I want to make my comment reply only available to admin and author user roles. How do I achieve that?
1
vote
1answer
44 views

Notification if Comment Author Field is left empty. E.g. change input border colour

I am having a comment section on my website. The author comment field is required. Any idea how to display a notification for a user if author field is left empty after submitting the comment? ...
1
vote
1answer
38 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
1answer
809 views

Full Front End, AJAX comment system and comment reply script

I am write a dynamic comment system, without page refreshing. The problem is, how do I move the "form" element to add sub comments? Like the comment-reply.min.js My workspace: <script type="text/...
0
votes
1answer
33 views

I'm unable to call img path using single quotes in an array?

I would like to call an image next to input field in wp comment form. But I'm unable to do that. I call image when '' <= single quotes doesn't exist. But I don't know how to call an image in single ...
1
vote
0answers
22 views

Assign author to comment from post edit page

How we can assign author to comment while creating this from post edit page. When i add new comment it always automatically assign login author to this comment. But i want there a select box that user ...
4
votes
1answer
1k 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', '...

1
2 3 4 5