A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
0
votes
1answer
17 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
18 views

Add a Comment on/off option in Screen Options for Comments?

In the Wordpress dashboard, I want to be able to add the option to turn off the Comment column. Can I do that via functions.php? I found a plugin that does a lot of things, but since I need this one ...
0
votes
1answer
15 views

Display custom posts, ordered by most commented, without duplicates

I would like to display custom posts in template, they have to be ordered by most commented and without duplicates on the same page. This is the code that I have for now. $args = array( 'post_type' =&...
0
votes
1answer
24 views

Display latest comments (global) with replies on a page

Trying to display the latest 50 comments (global, from all the posts) on a page (page.php) I am using this code: <?php $comments = get_comments('status=approve&number=50&type=comment&...
0
votes
1answer
15 views

How to customize the title from comments form?

I want to change the string on comments that is: n thoughts on post title is here I want to change that string from functions.php Please check the screenshot
0
votes
1answer
13 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
10 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 ...
0
votes
0answers
24 views

Comments on my custom post type

I have a custom post type gig and added the supports Comments but it doesn't show any comment input at all. $args = [ "label" => __( "Gigs", "understrap" ), "labels" => $labels, "...
0
votes
0answers
9 views

wp_list_comments(); stops all my separate .js files from loading

On single pages where there are comments, no separate .js files are being loaded. My comments.php file looks like this: if (have_comments()) { wp_list_comments(); } comment_form(); the ...
0
votes
1answer
19 views

TinyMCE as comment editor - encoding issues

I've implemented TinyMCE as my comment form on both the front- and back-end, using the below code (sourced from some questions here): // Enable TinyMCE as frontend comment editor for new comments ...
0
votes
1answer
21 views

User capability for editing their own comments

I'd like to allow certain (logged in) users to be able to edit their comments. I don't care if they can only edit through the back-end - obviously front-end editing would be lovely, but I'm willing to ...
1
vote
1answer
19 views

Update all comments time to random dates?

I found this code snippet which randomly changes all the dates for all posts. (Original Post : Update existing post dates to random dates ) <?php /** * Plugin Name: WPSE 259750 Random Dates * ...
1
vote
1answer
27 views

Comments to only be seen by their author

I am currently attempting to make comments that only the author when logged in can see those posts. Two different logins to the website cannot see each other's posts. I have found some stuff online ...
1
vote
0answers
11 views

Comment Pagination Behavior wp_list_comments() - comment ordering and pagination

I am using wp_list_comments with a callback function to display a list of all comments, and it's working well. I am then using paginate_comments_links to create pagination links, which is also ...
0
votes
0answers
31 views

Remove nofollow from internal comment links via functions.php

When someone leaves an internal link in the comments, rel="nofollow" is automatically added. How can I remove rel="nofollow" on all internal comment links left by visitors, while retaining nofollow ...
0
votes
1answer
11 views

Fetch commens from a specific post

I'm trying to fetch the comments from a specific post to show them elsewhere in the website. This is the code I use to fetch the comments of the current post; how do I edit it so that it fetches the ...
0
votes
0answers
11 views

Is there a way to implement Emojis into the wordpress comment area of a plugin - e.g. wp-discuss?

I would like to integrate emojione-emojipack into a wordpress comment area. I use wordpress + elementor. <input type="text" id="emojionearea1" /> <input type="text" id="emojionearea2" /> &...
0
votes
2answers
41 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 ...
1
vote
1answer
33 views

Show comments menu in dashboard only if the site has comment

I would like to hide "Comments" menu in Dashboard until the site doesn't have any comments. I tried to do this with this below code, but doesn't works: function remove_mainmenu_pages() { ...
0
votes
0answers
13 views

How to add a custom field on WooCommerce reviews form?

i have 2 problems with my code. 1. i can see only the title in the comments. cant see the cons. 2. how do i make the con's part to have a title "cons" and then the text that the user wrote. as oppose ...
0
votes
2answers
25 views

Disallow Comments

My web host has suspended my website because the comment sections of pages were being spammed so I can no longer access the site via wordpress. What files do I need to edit to switch off comments on ...
0
votes
1answer
15 views

Comments change the template name

I am following this tutorial: https://www.wpthemedetector.com/create-archives-page/ How come when I type the following block of code in a file named page-archives.php, the template name changes? For ...
0
votes
1answer
22 views

Comment restrictions Wodpress

I want to restrict new registered users on my WordPress site from writing comments until 3 days passed their registration date. What solution do you recommend? thanks in advanced.
0
votes
0answers
23 views

Why are HTML tags limited in comment section?

I see that HTML tags are limited in comment section. Is there a reason for this? What could go wrong if more are allowed? For example, the table, heading, image and list tags. FYI: Expanding the ...
0
votes
2answers
20 views

Remove the URL author of post on all comments

I can't manage to disable the URL of only the author's post. Here's an example : My website As you can see, the green link is mine (the author of the post). I only want to remove that link, not other ...
0
votes
0answers
24 views

Using Disqus with headless Wordpress setup?

Does anyone have any experience using Disqus with a headless WP setup? I am working on converting a standard WordPress blog to a headless front end, with the users using the standard WP back end in ...
0
votes
0answers
16 views

How to delete comments from front end — in Multisite?

I have a custom plugin that allows users to delete their own comments from the front end (and allows editors to delete subscriber's comments too). It works fine on a single Wordpress installation, ...
0
votes
0answers
27 views

Hooking into user_has_cap to let authors modify their own comments in other users' posts

I'm trying to modify comment permissions to allow author role users to modify their own comments in posts authored by other users. This is not possible in by default as it requires the edit_posts ...
0
votes
0answers
17 views

Allow user to manage reviews but not products

I'm trying to create a role that grants access only to the comments section of the admin dashboard and allows the user to approve the reviews on the products without allowing them to edit the product ...
0
votes
0answers
23 views

How to change “1 Comment” headers?

I use a blog layout on my site. For example, when you make a comment, you get titles like 1 and 2 comments. For example, when you make a comment, you'll get headlines such as 1 and 2 comments on the ...
1
vote
0answers
70 views

How to insert Comment metadata via REST API

I am trying to insert comment from my android app , i am using REST API and POST method /wp-json/wp/v2/comments/ The method is working great , but I would like to include metadata when inserting ...
0
votes
0answers
11 views

Easy way to create a “add comment ” widget for a special post?

is there a easy way to create a "add comment " widget for a special post ? so whith it, a user can add a comment directly from home page to this post. Please...help
2
votes
1answer
34 views

What should I hook to add extra fields to comments?

How do I add fields to the comment form, then display the data in the comment? E.g. the header/footer of a comment. Would it require template customisations?
0
votes
0answers
51 views

I can't post comment via REST API

I try to insert comment via REST API , but i get this error : Query parameter not permitted: author I followed this docs and author is one of the arguments this is the link test that i use https:/...
1
vote
1answer
29 views

How to moderate (manually approve) comments of a specific (registered) User

I have a WordPress blog that gets a ton of comments. I have a freelancer that does support on the blog and replies to these comments. In a tryout phase, though, I'd like the comments of this support ...
1
vote
1answer
32 views

In wp_list_comments(), what is a short_ping?

I've been looking at the documentation for wp_list_comments(). One of the options is 'short_ping' which is documented thus: ( boolean ) Whether you want to use a short ping. What on earth is a "...
0
votes
0answers
22 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
8 views

Need to output comment_form() function inside a foreach loop

Im trying to display a comment box inside a foreach loop however the comment_form function outputs before anything else. Here is the code I'm trying. Everything is displaying, just not in the right ...
1
vote
0answers
28 views

Comment pagination not working

I am trying to have pagination for comments with a widget. The comments are getting loaded properly but the pagination does not work. I have set the pagination in the WordPress set to 3 as well. ...
0
votes
1answer
20 views

How pass args to wp_list_comments callback?

i need to pass an arg to function that i am specifying as callback for wp_list_comments public function ggowl_comment_lister($ggowl_id,$icon_html){ $args = array ( 'post_type' => '...
0
votes
1answer
42 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
38 views

How to get the current post ID in comments.php?

I want to retrieve the comments of the current post in the comments.php file. I have this: <?php if (comments_open()) { $args = array( 'post_id' => "|what to put here ?|", ...
0
votes
0answers
23 views

How to add <div> inside WordPress comments loop?

I know we can add in posts loop using in index.php and in single.php by filtering the content but I don't know how to add after certain comments. For example, if a post have comments, after 30 ...
1
vote
1answer
19 views

How to auto empty comment trash after X days

I know how to programmatically delete comments that are X days old but they then go to the trash. How do I empty the comment trash every X days? function ...
0
votes
1answer
17 views

I cannot view the comments

I recently developed my wordpress site www.fingeroffury.com for blogging. I have put up a couple of posts which have garnered comments. Unfortunately the comments do not appear on individual posts. I ...
0
votes
1answer
20 views

Ajax Comment Upvotes - Votes don't always register

I'm trying to create a simple ajax-based comment upvoting system for Wordpress. I've managed to build most of it, but now it seems that most of the time the upvotes don't register. They do register ...
0
votes
0answers
11 views

How to hide wordpress post comment and add some text before and after the list of comment?

In my WordPress site I am showing all comments of each post in comments.php file using this code: wp_list_comments( array( 'style' => '<div>', 'per_page' => 10,...
0
votes
1answer
28 views

Comment System showing different type of IP

I am observing different type of IP in comment. IP is like this 2409:4064:695:f112:bb92:1b9a:de27:d3fb Website is nvshq.org Is this any type of spam or security concern?
0
votes
1answer
50 views

How do I add class to an admin comment?

When I customize the wp_list_comments() output, how do I add a class to the admin comments? Relevant code: <?php wp_list_comments( array( 'style' => 'ol', 'callback' => '...
0
votes
1answer
27 views

Can't get ID of post that relates to the comment

I added custom checkbox to the comment form. I am trying to write the post ID of this comment in the database. But without success. I'm trying with something like this: add_action( 'comment_post', '...