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

Questions tagged [comments]

Comments allow your website's visitors to have a discussion with you and each other. When you activate comments on a Page or post, WordPress inserts several text boxes after your content where users can submit their comments.

0
votes
0answers
12 views

Comment review not mandatory

I have a star rating system in my web, and I need comments to not be mandatory so that customers can review only using the stars. How can I do that? Thanks!
0
votes
1answer
26 views

how to SELECT for the current post id?

i am trying to get and count the values of a meta key (rating) and then calculate the sum. but the following code get all of values in wp_commentmeta table but i want to get just for the current post. ...
0
votes
0answers
24 views

How to display Post Creator/Post Author badge in comment?

I want to display Post Creator/Post Author badge in WordPress post comment. I don't want to edit comment.php, I just want custom function. Here I attach an image to show that what I want. link:- https:...
0
votes
0answers
38 views

how to have 2 comments_template() in one post

I have an issue in my new theme. my website is about Education for teachers and students. every post belongs to one teacher that students can talk to her/him via comments. now, i want to add a special ...
0
votes
1answer
9 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.
1
vote
1answer
10 views

How to validate recaptcha on comments form?

I've added the following code to my function file to add the recaptcha, however I do not know how I can validate the captcha. /** * Add Captcha to Comments Form */ add_filter('comment_form', ...
-1
votes
1answer
20 views

list / show comments of post author in special page

i have a problem and i need you to save me really. i have many post authors with a lot of comments that every day is submitting. so i want to show comments that has submitted in every post to its post ...
-1
votes
1answer
22 views

Customize comment notification e-mails with HTML

I want to customize the default content of notification e-mails i found the following codes. but i need to use HTML in my own content. would you please make it with HTML? i do not know enough about ...
0
votes
0answers
11 views

How to display recent comments of a specific taxonomy?

I have a custom taxonomy, for example region. Under this I've added several sub terms, such as Europe, Aisa, America. How do I display the comments for posts aligned to Europe only? Edit: I found a ...
0
votes
0answers
7 views

Group Disqus comments per URL

My website has a dynamic post based on its URL params. Basically, it's a common post but its content has only a short code that builds the final HTML. It seems that the Disqus comments are bound to ...
0
votes
0answers
23 views

Errors while trying to add Disqus to WordPress manually

I've been trying to add Disqus to my website for a while now. And I've used the universal embed code they are suggesting in their documentation. I add it to my single.php page with my shortname and ...
0
votes
0answers
15 views

Floating Comments

Is it possible to add a floating comment bar to a Wordpress site, similar to the one used at AminoApp: https://aminoapps.com/c/k-drama/page/blog/my-favorite-drama-quotes/...
0
votes
0answers
8 views

Comments show perfectly on regular posts, but won't display on custom posts

As the title says, I'm seeing no comment entry fields for custom posts, but they're working just fine for standard posts. In my functions.php: function custom_post_register() { // creating (...
1
vote
0answers
12 views

Share the same comments between more pages

Scenario: I need to share the same comments between more pages. Instead of simply using the post ID to load comments, I want to use a combination of two taxonomies' id. For instance: Taxonomy 1: tag ...
0
votes
0answers
15 views

A list of the top Authors with total comment count on a wordpress instance

I am trying to get a list of 10 comment authors with the total comment counts beside the username. Is is a user query or a should I use wp comment query? It should look something like this: John 10 ...
0
votes
0answers
19 views

how to fix Undefined variable: aria_req in comments.php

<?php // You can start editing here -- including this comment! if ( have_comments() ) : ?> <h2 class="comments-title"> <?php $comments_number = get_comments_number();...
0
votes
1answer
17 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
2answers
23 views

Change commenters email to display name

wordpress's default Recent Comments widget is showing the user's email address instead of their display/first name.. get_comment_author() just changes the email address to 'anonymous'.... What do I ...
0
votes
0answers
17 views

Display data from 'comments_clauses' in comment object

I want to add display name from users table to the comment object in WP, but failed. I don't know where is the error in my code below. This is my code. add_filter( 'comments_clauses', '...
0
votes
0answers
22 views

how i nested depth show under div of start_el() without style padding

I want to make nested list of comments displayed in nested divs of .media-body, like in the image below. How can I modify the code in wordpress in the start_el() function? it is not created nested ...
0
votes
0answers
16 views

How to change comment text while comment posting?

Can I add a filter to the wp_insert_post while posting a comment? I want to decode PHP tags before posting comment. Here is my code: function my_function( $comment_id, $comment_object ) { $...
0
votes
3answers
64 views

Automatically reject a comment if website field contains anything

I've done a bunch of searching but can't seem to find a hack to do this, all I can find is how to remove the website field from the form. I want to leave it there, but if someone enters a url into the ...
0
votes
0answers
18 views

Write html code in comments

For example i am writing this html code into comment textarea <pre><code class="language-php"><?php echo esc_html( get_post_meta( get_the_ID(), ‘_spp_count’, true ) ); ?></code&...
0
votes
0answers
22 views

User can post only one comment per day on some posts based on ID

I want to limit the number of comments per user (registered or not) per day. i used the codes of the answer in the following page but it did not work. i put the first code in the Functions.php and ...
0
votes
0answers
21 views

fake comments from dashboard/back-end

Does anyone know if there is any plugin / code snippet which allows to enter/crate a new comment from back-end ( by admin / being logged in as admin ) where user-ID / time etc. could be chosen?
0
votes
0answers
21 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
0answers
11 views

How to add reply comment feature in custom comment form

I have created a custom comment template; Here created a form and stored the data in my custom table. The stored data showing from table in frontend. This comment form is calling with in a loop for ...
0
votes
1answer
27 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(); ?>" ...
0
votes
1answer
22 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
0answers
7 views

Use custom profile field in comment

On registeration I added 2 custom profile fields. How can I use these 2 fields on the comment section. For example I want to display the value of "City" field, just before the nickname, for example :...
2
votes
1answer
31 views

Does wp_new_comment expect a comment in HTML?

Should the comment_content in this example contain HTML? Or should it contain plain text? $comment_id = wp_new_comment([ 'comment_post_ID' => 1, 'comment_content' => 'Tom & Jerry', /...
1
vote
1answer
124 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 ...
1
vote
0answers
29 views

Showing unapproved comments without login

I'm working on a wordpress theme for my website. My website doesn't allow to sign up and my theme's blog page have comments section and it allow making comment without login. But there is a problem ...
0
votes
1answer
29 views

How to direct user after comment save

I've been trying to direct the user to the specific page after they posted the comment, but that not luck for me. Here is the my code blocks My first try: add_action('wp_insert_comment', array($...
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
24 views

User Comments on separate author page

I have added the user comments to author page (archive template), after the blog posts if any. So on page www.my.blog/author we have blog posts and all the user comments display below the posts. ...
2
votes
0answers
26 views

Comment pagination - How to show determined number of comments on the first page?

I set 10 comments for every page. If I have 20 comments, it shows 10-10 on the first and last page. However if I have 11 comments, it shows 1 comment on the first page. How to display 10 comments on ...
3
votes
1answer
63 views

Why Allow Script Commands in Comments?

I noticed that if you are an admin or editor, you are able to put in script code like this in comments (not in the page/post editor) for admin/editor roles: <script>alert("Danger, Wil Robinson!"...
0
votes
1answer
47 views

Sent comments notifications to multiple users

I am new to wordpress I want to send email notifications for commenting in blogs. Currently it is going to only one user. I tried 'comment notifier' plugin but got negative result. I tried the below ...
0
votes
2answers
45 views

Moving FB comments at the end of page

I am using plugin "wpdevart facebook comment" for posting comments at the end of every post. They are displaying good But now I want to shift those comments little below of pagination and ads Or at ...
0
votes
1answer
25 views

Custom Avatars for Wordpress Comments VIA Website URL?

I've tried a couple different wordpress plugins and solutions but nothing is quite what I'm looking for. I want to adjust my theme/wordpress so that avatars for my Wordpress commenters are grabbed ...
0
votes
0answers
90 views

“Comment is awaiting moderation” gone!

As i said this notification is gone after new Wordpress update. I can't find solution. My comment lists coming with this code: <ol class="comment-list"> <?php wp_list_comments( ...
1
vote
0answers
21 views

How To Add a Transition style to Wordpress Comment Box? [closed]

What I am looking for is to have the comment box slide down when a user clicks the reply button. I have tried several ways of adding my own CSS transition to the respond id and even did a height ...
1
vote
0answers
24 views

How to make an WordPress element sticky? [closed]

I'm trying to make an element sticky on my article. This is the element- Name: WP-Review <div Class=sticky-review> <?php echo do_shortcode("[wp-review]"); ?> </div> I tried CSS- ...
1
vote
0answers
15 views

WP_Comment_Query - Get comments and answers separately

I was developing a theme and this time I chose to use the bootstrap4, I found some difficulties in the way but I managed to solve them and the result was satisfactory, however creating my comments.php ...
0
votes
1answer
14 views

Comments/Discussion Not enabled on newly created posts/pages

Like the title says, new posts and pages do not automatically have comments enabled, even though I have the option checked in discussion settings. Any ideas why it may not be working?
1
vote
0answers
44 views

Send reply with pre-prepared answers

Do you know the way to ask users' comments with pre-prepared answers? What i want is very simple and more like a comments section that only can select and remove emojis without typing and have 4 ...
1
vote
1answer
15 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', '...
1
vote
0answers
35 views

posts comments goes to trash

My website was working fine until today, I just discovered that all comments made goes straight to trash. I did not install new plugins, I don't have akismet. It just started. I have deactivated all ...
1
vote
0answers
10 views

wp-comment author- url +, email filter hook

Don't know how to change '@' and 'HTTP/S' in ALL comment-stuff, so those will be displayed in WP as unclickable contents. Do you have the knowledge and patience to straighten the following lines? ...