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.

1
vote
2answers
46 views

Adding ads code between comments

I am showing comments on my page. I want to show 1 ad after every 2 comments. <div class="panel-ads clearfix"></div> it's repeating the number of comments. I would like to add the ad ...
0
votes
2answers
20 views

How do i remove “Website” field from Wordpress comments

i have two websites i use Wordpress comments on one website and jetpack comments on another. Both websites shows website column, how do i remove it to save my site from giving unwanted backlinks ?
0
votes
0answers
15 views

paginate_comments_links is not working!

i have problem with comment pagination. i set the options in Settings → Discussion (e.g: one comment for every page) but it is not working anymore!!! my single-news.php is so: <?php if(...
0
votes
0answers
8 views

Open Post Comments in a Pop up / Modal when clicking comments link on homepage - Wordpress

I would like to display the comments of a post in a pop up / modal whenever a user clicks the comments link excerpt located at the Homepage. I am able to open the_content in a modal, but i only need ...
0
votes
0answers
14 views

Wordpress weird behaviour on comments

Every time I make link in one of my posts (post B) to other post (A), The post A gets a comment that it's content is a section of Post(B) that contains the title of the link I've made. As an example ...
0
votes
0answers
12 views

How to get_comments() ordered by date and parent?

So my starting point is: <?php $comments = get_comments(array( 'post_id' => $post->ID, 'status' => 'approve', 'type'=>'comment', '...
0
votes
0answers
16 views

Consecutive comments on WordPress take a 10 second gap before being able to comment again

When I try making multiple comments on my app, It requires a 10 second gap at least before making a second comment. If I try making an immediate comment after saving the first one, The new comment is ...
0
votes
1answer
12 views

Subcriber getting multiiple notifications for new comments

This the email i received from a subscriber, i am not sure how to prevent multiple emails from going out.I do not use a plugin just the WordPress native comment mamagent “Notify me when new comments ...
-1
votes
1answer
11 views

How to get the actual time, without the time

At this moment I am busy writing a widget, you can place on each page. One of the problems I am facing, is that I want to remove the time from the comment. foreach (get_comments($args) as $response) ...
0
votes
2answers
20 views

Comments are in database, don't show up in WordPress backend or frontend

I am in the process of rescuing the content from a WordPress site with a bloated/damaged database. Everything has gone according to plan except for the comments. I can see that the 4000+ comments are ...
0
votes
1answer
25 views

Only allow the post author and admin to comment on a post

I've searched the interweb and stackexchange high and low and found nothing on how to restrict comment submissions to 1. the post author and 2. the admin.
0
votes
1answer
22 views

How to prevent users/authors from seing IP/email of new commentators?

I have a plugin on my WordPress installation that allows users to suggest ideas. This results in them becoming the author of a post (although their role is still just "subscriber"). I received ...
0
votes
1answer
22 views

Why are my threaded comments not quite working? [closed]

I had to switch from DISQUS as it got blocked in China and thus doesn't work and slows page loading down. I had hundreds of comments some were threaded, I got them to display correctly, but if I add a ...
0
votes
0answers
16 views

No comments allowed

my posts won't allow commenting. I have checked the discussion > Allow comments and Allow trackbacks and pingbacks on this page in my post settings. I also checked settings > discussion > Default ...
0
votes
0answers
13 views

Unable to view comments on my website

I apparently have several comments as the number appearing in the comment section on the dashboard for some reason I can't seem to view the comment.
0
votes
1answer
19 views

get_comments_number() giving wrong results! What are alternatives?

get_comments_number() function giving wrong results because of a plugin filter. Which function can be used instead of get_comments_number() ?
0
votes
0answers
17 views

Replace gravatar with user meta, by using filter

In this post, explains how to make my question. It filters user_avatar. I use same way with filtering user_avatar_url for using in <img src=""> Here is my code: function replaceAvatar( $url, $...
0
votes
1answer
30 views

How to check, if user commented before, on comment_post action?

I want check, if user commented post, in comment_post action. So i make this: function checkUserComment( $comment_ID ) { $comment = get_comment( $comment_ID ); $postID = $comment->...
0
votes
0answers
8 views

How to get terms by posts total comment count?

Is any way to make it? Just calculate posts comments total number and order terms by this. Is it possible? $termArgs = array( 'taxonomy' => 'category', 'hide_empty' => 1, 'orderby'...
0
votes
1answer
14 views

Limit Comment Line Count - Add Read More Button

Is it possible to limit how many lines of comment are displayed with the option to load more?
1
vote
1answer
50 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
14 views

Comments stuck inside post edit, but not showing under the published posts

I recently migrated my site from blogger.com to wordpress using "blogger importer extended" plugin. Everything has been completed without issues, except this one. Many of the posts are not showing the ...
0
votes
0answers
15 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
30 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
1answer
80 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
25 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
22 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
32 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

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
1answer
81 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
9 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
13 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
1answer
20 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
24 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
20 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
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
67 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
24 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
22 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?
1
vote
0answers
36 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
30 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
55 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
45 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
240 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
34 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
37 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
22 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.