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
1 answer
93 views

How to remove website url field from comment form completely?

I have this in my functions.php /*Remove website field from comment*/ function xyzmark_remove_url($fields) { if(isset($fields['url'])){ unset($fields['url']); } return $fields; } add_filter('...
sanjay ojha's user avatar
0 votes
1 answer
31 views

Prefill the textarea in comment_form

I would like to put a prewritten comment in the WordPress comment section by modifying comments.php: <?php if ( comments_open() ) { comment_form(array( 'title_reply'=>'', 'label_submit' => ...
joxyzan's user avatar
  • 13
0 votes
0 answers
61 views

Make comment textarea input un-required

Goal: I need to hide/disable the text-area comment field, and only display author field. I've succeeded in doing this with the code below. Problem: Text-area comment input is hidden, but is still ...
Unloving1507's user avatar
0 votes
1 answer
25 views

Wanted to get rid of Paragrapgh tag in submit buttom of the WordPress form

function modify_comment_form_fields($fields){ // Check if $fields is an array if (!is_array($fields)) { return $fields; } ob_start(); $submit_button = ob_get_clean(); $submit_button ...
WordCent's user avatar
  • 1,827
0 votes
0 answers
36 views

Show success message on comment submit when email and name is not required field

As you know in WordPress when you select "author must fill out name and email" and the user submit a comment it shows "is awaiting moderation". But when name and email is not ...
saraee's user avatar
  • 1
1 vote
0 answers
65 views

Error 403 when posting comments to a custom post type from a different page

Im trying to make a simple ticket support system by using custom post type, comments and a page. So it works like this, User creates a ticket with details and it's inserted into the custom post type &...
CruzZ's user avatar
  • 11
0 votes
1 answer
35 views

Replace Entire Comment Box with Text

I have a need to disable comments for a specific group of users. But I want to replace the entire comment box with a message like "Sorry, you are not allowed to enter a comment". Other users ...
Rick Hellewell's user avatar
0 votes
1 answer
681 views

How to hide and disable URL and email fields from comments?

How can I hide and completely disable (in case of bots) the URL and email fields in comments? There are a few free plugins that seem to do this, but most of them only hide the URL field and not the ...
Jesse Nickles's user avatar
0 votes
1 answer
250 views

How to filter comments by comment_meta

EDIT: Yay, solved it! I needed to use new WP_Comment_Query( $args ) and set my $args to only include the current post and the meta chosen. Thanks! Thanks to the wonderful help of the community here, I ...
DJZEEGLER's user avatar
  • 119
-1 votes
1 answer
211 views

Clicking Comment "Reply" Button only replies to first comment

I'm editing my comments.php, and within it I've added a reply button like this: <div class="reply"> <a rel="nofollow" class="comment-reply-link" ...
Nicolas Gimelli's user avatar
0 votes
1 answer
51 views

How to create a classified section in place of comments_template

I am running a site where users can find great information about musical artists and their releases. Each release is a wordpress post. Each artist is a wordpress post. In my single-artist.php and my ...
DJZEEGLER's user avatar
  • 119
0 votes
1 answer
56 views

How to change Akismet commenter privacy notice?

I read the supposed explanation posted on their blog, and came away unenlightened. The following site-specific plugin does nothing (I have enabled it): <?php /* Plugin Name: Akismet Better Privacy ...
JamesTheAwesomeDude's user avatar
1 vote
1 answer
217 views

How to make comments private for commentor and post author

I am trying to make comments private. I mean comment must be visible for post author and comment author. I create custom comment section "better-comment.php". I have used pre_get_comments ...
Teymur Abbasov's user avatar
0 votes
1 answer
147 views

Changing the Comment Fields using Filter (without success)

Am I doing this all wrong or should this be working? No matter what post I visit, it's thrown into an endless loop.. This is the code: add_filter('comment_form_fields', 'comment_form_args'); function ...
Marcus Wood's user avatar
0 votes
1 answer
29 views

Name of comment field differs on different sites

I have a question regarding the „name“ of the comment field of wordpress blogs. I have 2 sites, that are just available locally on my LAN. On the first site, if I inspect the comment field in firefox, ...
mathse's user avatar
  • 11
0 votes
0 answers
1k views

COMMENT FORM Error: Please type your comment text

Error: Please type your comment text. I Created COMMENT FORM but Error happened which is above. I dont know hot to fix this Anyone help me please Thank you very much! Function.php /** コメント一覧表示部分のコード(...
kaz Oh's user avatar
  • 1
0 votes
0 answers
28 views

How do I make the comment disappear after deleting from the database?

I can delete the comment from the database with this code, however when the page is loaded again the comment will still be there. I need to update again to disappear. How do I resolve this? ...
Patrique Uiliam's user avatar
1 vote
0 answers
183 views

Display complete comment section via post ID

what I want to achieve: I would like to display the complete comments (including answers and the comment form) of a certain Page ID in the middle of my home page (I use WPBakery Page Builder). These ...
Konrad's user avatar
  • 11
0 votes
1 answer
550 views

Modify "Must be logged in to comment" text/links?

My site requires users to login to comment. Unregistered and logged out users see "Must be logged in to comment. You may also register for an account." How do I change this text and the ...
SCYankee's user avatar
0 votes
1 answer
110 views

Use of comment_reply_link_args filter

i am trying to create a filter like this add_filter('comment_reply_link_args','change_author_title'); function change_author_title( $args ) { $defaults = array( 'add_below' => '...
Honoluluman's user avatar
0 votes
0 answers
31 views

comment just attachment .. reply just text ... can I do that?

I want comments just to upload videos without text but replies the opposite I mean comments just to upload videos.. without text area ... in replies its a must to write in text area without any ...
Roah's user avatar
  • 1
0 votes
1 answer
39 views

How to put the author of the post in the comments?

I need to put the name of the author who wrote the post and I can't find the solution. EXAMPLE: Rachel [06/03/21] : Commented in the post "How to be a Web Designer", written by: POSTAGE ...
Patrique Uiliam's user avatar
1 vote
1 answer
45 views

How do I target a single page to modify the comment form of only that page?

If I want to globally change the comment form for a theme I would use add_filter for "comment_form_default_fields". Then I might use add_action for "comment_form_logged_in_after" ...
Matthew Brown aka Lord Matt's user avatar
0 votes
1 answer
66 views

Custom sort comments with select form

I use ACF Pro to create a customized comments section with additional fields to my custom post type called Products (it's a simple page with a custom comment section, NOT using WooCommerce). Now ...
Aleksandar's user avatar
0 votes
0 answers
46 views

Edit Comments Fields

I need to edit the comments fields. 1 - The metadata should be only date; 2 - The comment itself should be trimmed; 3 - the word 'says' next to the name should be gone; I believe I can manage the ...
stemon's user avatar
  • 155
0 votes
1 answer
750 views

Display the list of user's comments + the post title + date

I am trying to display the current user's ALL comments in a specific page and I'm using this code (uses a shortcode): https://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/ ...
cloyd concepcion's user avatar
0 votes
1 answer
185 views

Replace text by icon in TinyMCE toolbar

I added TinyMCE in the post comment textarea by adding this into my child theme function.php function rich_text_comment_form( $args ) { ob_start(); wp_editor( '', 'comment', array( '...
dragoweb's user avatar
  • 249
0 votes
1 answer
40 views

Comment Form Development Issue

I am new to wordpress theme development and I am trying to create a custom comment form. I read the documentation and I have a reach a point that I am happy with the layout but I have 2 issues with ...
Dimitrios Pavlis's user avatar
0 votes
1 answer
44 views

Same comment section on every page

I'm looking to basically have a unified comment section, so if a user posts on page a, it also shows on page b. I've searched online but have been unable to find any documentation on this and wondered ...
Fletch Armstrong's user avatar
0 votes
0 answers
22 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 ...
AHrtzt's user avatar
  • 13
0 votes
1 answer
346 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 ...
Divyang's user avatar
  • 13
0 votes
1 answer
230 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 ...
Gidromasservis QSC's user avatar
0 votes
0 answers
236 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
Mohammadreza Afzali's user avatar
0 votes
1 answer
115 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'] ) >...
klvb's user avatar
  • 21
0 votes
1 answer
830 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 ...
wpdd's user avatar
  • 313
0 votes
1 answer
352 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 ...
Chillin''s user avatar
  • 101
1 vote
1 answer
904 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 ...
Naser.Sadeghi's user avatar
1 vote
1 answer
55 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 ...
Aslan's user avatar
  • 55
2 votes
2 answers
661 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. // ...
Bikram's user avatar
  • 338
0 votes
0 answers
46 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 [...
Manthan Kanani's user avatar
0 votes
1 answer
454 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 ...
fatihturan's user avatar
0 votes
1 answer
102 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 ...
Shoaib Saleem's user avatar
1 vote
0 answers
140 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 ...
marvin castro's user avatar
0 votes
2 answers
172 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 ...
Shamsher Ali's user avatar
0 votes
0 answers
187 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 ...
Serdar Koçak's user avatar
0 votes
1 answer
874 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(...
user avatar
0 votes
1 answer
26 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?
Matthew Brown aka Lord Matt's user avatar
0 votes
1 answer
2k 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 ...
Shoaib Saleem's user avatar
0 votes
0 answers
36 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 ) { ...
Mark71's user avatar
  • 3
0 votes
1 answer
2k 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 ...
A. Muller's user avatar

1
2 3 4 5 6