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.

Filter by
Sorted by
Tagged with
1
vote
0answers
6 views

Wordpress comments_open for specific user role or post type

comments_open is used for both post types, posts and products, the snippet below worked and allowed only (example) role users to comment enter code here add_action( 'init', function(){ $u = ...
0
votes
1answer
33 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
0answers
20 views

How to prevent spams from admin-ajax.php file?

I noticed today that a spammer is posting comments on my website using the admin-ajax.php file. Does this mean that my website is hacked? If it is not hacked, how can I prevent that person from ...
0
votes
1answer
10 views

How do I automatically insert some text in the comment textbox on submit?

So, you can't submit a comment without adding some text... So, how do I automatically insert some text in the comment textbox on submit (even if I haven't added any text myself)?
0
votes
1answer
22 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

Remove Comment Author Link only for subscribers

I am using this function add_filter( 'get_comment_author_link', 'remove_comment_author_link', 10, 3 ); function remove_comment_author_link( $return, $author, $comment_ID ) { return $author; } to ...
0
votes
1answer
11 views

Use country flag as user avatar based on comments IP address?

trying to find the way to allocate a country flags instead using MisteryMan icon, Gravatar or User Avatar. Any help or suggestion about where to start?
0
votes
0answers
10 views

Comment replies are not nesting because of YoastSEO plugin

I am using a child theme of the Public Opinion theme by CSSIgniter. This child theme only has a few modifications. You can visit the website by clicking here. I am unable to nest comments from the ...
1
vote
2answers
12 views

How can I & how do I change text displayed in comment via child theme

This isn't a specific theme I'm asking for, well, yes it is, but I assume the answer would work on any theme.. I've recently learned little about child theme, but I'm not understanding how to change ...
1
vote
1answer
18 views

How Does comment_author Filter Work?

I want my plugin to add extra text after a comment author's name. For example if they've commented as "Albert", I might want the comments section to display their name as "Albert (genius)". I'm ...
0
votes
0answers
10 views

PAGE_URL & PAGE_IDENTIFIER wordpress for disqus comment box code

I am adding the Disqus comment box on my Wordpress website. I don't want to use any plugin. I directly want to paste code on the website. Following is the code: <div id="disqus_thread"></div&...
0
votes
0answers
21 views

Comments not showing in post edit in Admin section

I've got a issue displaying comments in the post section !! When i debbug and click on the Show more comments (Afficher les commentaires) in the dev/network it bring the results but the loading ...
0
votes
0answers
10 views

Comments like and share without plugin

How do you add a comment like and post share functionality without a plugin? Any help (code snippet, tutorial, anything) would be appreciated.
0
votes
0answers
17 views

Comment area visible but comments not being saved

I've researched this and I only found issues relating to the whole comment "area" (below posts) not appearing, but the issue I'm experiencing is different. (I refer to the blog as "my site" when I am ...
-1
votes
0answers
8 views

How do I post an image to a wordpress comment?

I want to post an image in a comment in kaalus.wordpress.com. How can I post a comment with an image? I do not own the blog, but the owner allows comments with images because I see comments with ...
0
votes
1answer
21 views

How to hide wordpress post comment form for specific role

How to hide "comment_form();" for Author role in wordpress? What i need to add in comments.php?
0
votes
0answers
9 views

Wordpress redirection after submitting duplicate comments

in my testing env, whene i post duplicate comment, wordpress redirect to wp-comments-post.php, How can i stop the redirection and make it to custom errors page, ??
2
votes
3answers
102 views

How to edit user_id on the comment edit screen

All guest comments are user_id = 0, while registered users have their unique user_id attach to the comment. How to edit comment user_id from the comment edit screen. I think I need to use ...
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....
0
votes
1answer
32 views

How can I show comments in random order?

I can't find a snippet to show my comments in random order (not the posts, there's tons of entries for that one). I need this for my community page - I don't want them ordered by date. It's part of ...
0
votes
0answers
8 views

How can I allow only admin to see the unmoderated comments?

I have some authors and editors on my blog. But i dont want them to see the comments that're still not moderated. How can i do it? I tried to modify capabilities but no option to do that.
1
vote
1answer
44 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
8 views

I want that people can add miltiple pictures on comment

I want that people who comments on my site they can upload pictures like quora. Where people answers questions with multiple images.
0
votes
0answers
15 views

How to Remove URL Field from Comment Form in GeneratePress Theme?

I wanted to remove the URL field from the comment form in Generatepress Theme. I have created a child theme and the used below code. add_action( 'after_setup_theme', 'tu_add_comment_url_filter' ); ...
0
votes
0answers
23 views

Custom pagination permalink structure Product page

I'm using WooCommerce. And WC has an ugly link structure /product/category-name/product-name. I removed /product/ from the url. But now I'm facing an issue. On the product page reviews are shown, when ...
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
0
votes
1answer
11 views

Keep comments but turn off commenting

What I mean is this: I have over 600 comments in my site, and I want to keep them all, but, I want to remove the ability to comment. If I turn off comments then everything is removed. I can achieve ...
1
vote
1answer
42 views

Callback function argument which is required for wp_list_comments ()

comments.php <?php $args=array( 'type'=> 'comment', 'callback'=>'my_comment_list', ); ?> <ol class="comments-list"> <?php ...
0
votes
0answers
18 views

Where are comment ratings stored?

I have a bilingual site. Previously I was using a language plugin that would store the different languages in the same post which means all my comments belonged to that post. I switched to WPML which ...
0
votes
0answers
15 views

Is there ANY way to hide comments session and user bio session from certain tier of login users?

I have a website, and have 3 tiers for different 3 types of paying members. Let's say type A is free members, and B and C are they premium paid members. Now I would like to hide all the bio (the ...
0
votes
1answer
41 views

How to limit specific user ID to 5 comments per post?

Can someone please give me a function to limit a specific User ID to 5 comments per post? I found several questions on how to put a limit of one comment per post on all users. However, I need to place ...
0
votes
0answers
69 views

How do I fetch all comments per post via WP REST API?

I am busy trying to understand how WP REST API works in combination with React. When I check the documentation of WP REST API, it confuses me a bit. https://developer.wordpress.org/rest-api/reference/...
0
votes
1answer
14 views

How to style archive post titles… but only those posts who have comments?

How would I style archive post titles for only those posts who have comments?
0
votes
0answers
19 views

How to remove WordPress Default Comment? not Facebook

I want to remove the Wordpress default comments system from my website but Wanted to keep Facebook Comments Only. Just like Scoopwhoop.com is doing! Thank you in Advance!
1
vote
0answers
12 views

Filter out other users comments. Visualize only own comments and editor role users' comments

I have a similar request as per question but I am totally not into php and would not know where to start to make such edits based on the answer provided. Would be great if anyone could help here. ...
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 ...
0
votes
0answers
13 views

WP Comments with CSS Counters

I'd like to use CSS counters on WP comments, like this: 1 (first comment) 1.1 (reply 1) 1.2 (reply 2) 1.2.1 (first reply to 2) 1.2.2 (second reply to 2) 1.3 (reply 3) 2 (second comment) 2.1 (reply 1)...
0
votes
1answer
24 views

How can I style the Comment Section of a blog post

I am trying finish styling this page. Once someone posts a comment, it looks like this (see below). I am trying to get the background area just plain black, just like the actual blog text. Then the ...
0
votes
1answer
30 views

transition_comment_status doesn't work in case of admin comment

The transition_comment_status works perfectly when I approve or unapproved comments. More accurately it works what it says, it fires whenever any comment status change. But in case of admin, it doesn'...
0
votes
1answer
40 views

update_post_meta not working with transition_comment_status

I'm trying to save an average of comments as a post meta that needs to be updated every time according to comment status. /** * Gets comment average data. */ function sw_get_averagerev( $post_id ) ...
0
votes
0answers
10 views

Wordpress popup asking usermeta info from the user

I am writing a code for a unique task, trying to describes thru below steps: User Log-in to his/her account User wants to comment on a post A popup will come and ask his mobile number (This mobile ...
0
votes
0answers
10 views

comments loading in wordpress dasdboard

I am trying to view the comments of the post in the wordpress dashboard but it loads all the time and didn't display anything like in the image
0
votes
1answer
5 views

How do I refresh “Post Last Modified Time”, as long as comment is updated to Approve status?

I read from another question and tried their code which is pasted below - Update post date on every new comment? This code is working well, however it updates the time when people Insert Comment in ...
2
votes
2answers
115 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
19 views

Nested replies only working in Edge

I have enabled WordPress' nested comments in my settings and I have added the relevant code to my comments template. In my comments.php I have: <ol class="commentlist"> <?php ...
0
votes
0answers
23 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
59 views

How do I add custom field to Admin comment form and display

I am talking about the back-end not the front end of the website. I have added custom fields to my comments on the front end of the site and want to display the results on the back-end. Each comment ...
0
votes
0answers
14 views

Create another comment section for WordPress

I want to create another comment section for a post type. For example one for comments and one for reviews. is this possible?
0
votes
1answer
20 views

I would like to count number of comments after 5 days ago

this is my code, and the result shows always the total number of comments instead of number of comments after 12 february 2020. I don't know why it does not working. #!/usr/bin/php <?php ...
0
votes
0answers
20 views

I would like to count number of comment in 4 hours

I'm trying to count the number of comments in last 4 hours. I try to do that with bash command but I don't have the result that I want. I created test.sh the code is : #!/bin/bash date=$(date --...

1
2 3 4 5
36