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.

508 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
91 views

How to hide "Trackback" on paginated comments

My Setup: On my Single's page I have used this comments_template('', true); to separate Trackback's & regular comments. The Heading "Trackbacks for this post" shows up only if a post has ...
3
votes
1answer
108 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!"...
3
votes
1answer
1k views

How to move comments form above comments list in wordpress

Please help me modify code to move Comments form above comments list in a WordPress blow. Below is the code of comments.php page <?php /** * The template for displaying Comments. */ ?> <?...
3
votes
0answers
125 views

Comment count wrong with orphaned comments

I have a news site set up with nested comments enabled. When a comment is marked as spam it is correctly removed from the article page however so to are any replies to that comment. This makes sense ...
3
votes
1answer
62 views

How to enable comments options?

On page --> Screen Options --> check Discussion --> Discussion --> Allow commets --> I have checked on discussion options. Settings --> Discussion --> I have checked on Allow people to post comments ...
3
votes
1answer
162 views

WordPress comment count to include attachment comments

How can I make the comment count on a post on my index page include comments that have been made on, in my case, individual gallery pictures that are included in the post? It seems that comments made ...
3
votes
2answers
674 views

How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

I added the following to my functions.php: add_action('pre_get_posts', 'keyl_get_emp_posts'); function keyl_get_emp_posts($query) { if ($query->is_main_query()) $query->set('...
2
votes
2answers
136 views

Threaded commenting: how to show threads by last active first?

Hi all and happy holidays! I have a page on which I enabled threaded commenting. At present, the comments are ordered new to old by when the thread started: -Comment 3 -Comment 2 -Comment 5 -Comment ...
2
votes
1answer
913 views

Uncaught TypeError: Cannot read property 'firstChild' of null after upgrading to WordPress 5.5

I am getting the following error from comment-reply.min.js (which seems to be a WordPress file): Uncaught TypeError: Cannot read property 'firstChild' of null at comment-reply.min.js?ver=...
2
votes
0answers
33 views

Draft / schedule comments?

I’d like to be able to draft and schedule comments, similar to how you can with posts/pages. Anyone know the best way to achieve this?
2
votes
1answer
31 views

Why do comment moderators need to have all create/edit/delete toboth posts and pages?

I struggled quitea bit to be able to set up my moderator account. Until I allowed all posts and pages capabilities and now the can finally moderate comments. I didn't deactivate one by one precisely ...
2
votes
0answers
214 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 ...
2
votes
1answer
625 views

How to add a title field in comments?

Just like WP posts have title and text, I want to have titles to my comments. Now how do I add it and show them above the comment texts like a title. I need it to have a css name as well. The title ...
2
votes
0answers
100 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 ...
2
votes
0answers
27 views

Disable Post/Page comment emails for creators

I have a Wordpress based blog with several admin users, and many pages with comments. There is a main email account set up for all comments to be emailed to. We have noticed that besides the main ...
2
votes
0answers
41 views

How to allow a particular role like Contributor be able to only view pending comments and approve them?

I want to allow Contributor role, of which does not have access to Comments (if it was allowed I disabled with adminimizer), to be able to view only Pending comments, and be allowed to approve the ...
2
votes
2answers
36 views

stackexchange-like submit comment window

I am developing my comments submission form and i would like to create sth like http://wordpress.stackexchange.com window ( the one i am writting now in) with B, I, add hyper-link and photo, and ...
2
votes
1answer
297 views

Restore trashed posts with comments

When a WordPress post is trashed, all the comments are trashed as well. I would expect the "undo" button to restore both the post and the comments. However, all the comments seem to just disappear : ...
2
votes
0answers
42 views

Comments not nesed with custom template

I have a custom template for to show my comments. For some reason, there are not nested while looking in the back-end of Wordpress, I see that some comments have a parent. They are simply displayed ...
2
votes
0answers
59 views

Show top level comments ordered by number of replies

I am trying to modify the comment loop initiated by wp_list_comments to change the order they are returned. Specifically I have 2 levels enabled on my comments (top level and replies), and I want to ...
2
votes
0answers
202 views

changing comment-page-# to something like review-page-#

When you enable pagination for comments in wordpress the typical pagination page for a comment is "comment-page-1" "comment-page-2" etc. what I want is this to appear like "review-page-1" "review-page-...
2
votes
0answers
1k views

How to import only certain comments from post[s]

NOTICE: This is solely NOT a WordPress.com Question, but related to WordPress Migration and Export-Import. I started blogging in WordPress.com and then shifted my blog to a self-hosted site. But even ...
2
votes
1answer
74 views

Disable comments

I'm wondering if there's any way to prevent users from leaving comments but still display the comments form? So, whenever a new comment is posted, it should be automatically trashed or it shouldn't be ...
2
votes
1answer
91 views

Users with custom roles can't read each other's comments

My site has a custom role ("coach") with its own set of capabilities (via map_meta_cap along with a few built-in roles). Each user is assigned a page on the site that they "own" and can edit (via a ...
2
votes
1answer
711 views

edit_comment capability for subscriber

I have given my site's subscriber role the following permissions (unserialized DB-query): [subscriber] => Array ( [name] => Reader [capabilities] => Array ( ...
2
votes
1answer
264 views

"Allow Comments" box cannot be checked

I've registered a custom post type, ensured that 'supports' has 'comments', and comments are allowed on new posts under settings -> discussion. I do see the check boxes for allow comments and allow ...
2
votes
1answer
2k views

Retrieve comments from current post using SQL

I am trying to use this code below to auto-refresh comments but at the moment it is displaying all comments. I would like to only show comments for the current post. I am not very experienced with SQL ...
2
votes
0answers
93 views

Display posts with comments closed, with pagination?

i'm using a custom query, which needs to display all posts with closed comments. I have this <?php $the_query = new WP_Query('showposts=-1'); ?> <?php while ($the_query -> have_posts()) :...
2
votes
1answer
163 views

What filter/action hook can I use to add a few links to the admin comments page?

I would like to add a link to every comment when it's displayed in the recent comments admin page (edit-comments.php). For the sake of this question, the link should just be this: <a href="mailto:[...
2
votes
1answer
1k views

Allow contributors to moderate comments comments on posts they write

I run a multi-author wordpress site where we have a large number of contributors that can write articles, which are published after they are reviewed by an editor. (This is all standard wordpress ...
2
votes
2answers
1k views

How to remove these comments and html tags from the content?

These are actually input fields. paragraph is the textarea field. i query the contents from database and try to show them in this textarea field. But the textarea field is showing me unwanted comments ...
1
vote
0answers
31 views

Sending data from custom inputs in Wordpress comment form in the admin notification email

I have added a number custom inputs to the standard Wordpress comment form. Currently, I don't send these values to the database, but I know I can send this data to commentmeta table if I need to. I ...
1
vote
0answers
36 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 ...
1
vote
0answers
13 views

Can comments by a logged-in user be displayed at the top?

EDIT: I answered my own question! I was able to do this using 3 lines of CSS - thanks, flexbox! leaving this here in the hopes that it helps someone else someday :) .comment-list{display: flex; flex-...
1
vote
0answers
129 views

Comments invisible after moving Wordpress to new server, while commenting still works

I moved a wordpress installation from one server to another. I dumped the DB, copied over all the files, put all DB data into a new database, changed wp-config.php to the new database info, and after ...
1
vote
0answers
43 views

Why does my callback function not work with this custom filter hook?

I'm trying to add a new key/value pair to my comment in the database by using a filter found in a WordPress plugin. This is the function where the filter is defined: /** * Parse comment before db ...
1
vote
0answers
26 views

"You must be logged in to comment" but I am already logged in

Latest WP running on RHEL 6.10 PHP version 7.2.21 MySQL is old and should be updated, but I doubt it's the reason. I have a Multisite setup going. I have a primary, call it blog.world.com, with a ...
1
vote
0answers
118 views

change wp_login url and redirect users at the same time

i use woodmart theme for my woocommerce shop. but in mag(weblog) page if a user want to submit a comment it redirects user to wp-login-url instead of woodmart login page. i found my first part answer ...
1
vote
0answers
19 views

Customize Theme comment template to Insert VoteUp and VoteDown buttons

I am using a theme that has an okay comment template that I would not want to change. However I just want to insert voteup and votedown button directly below the User avartar <ul class="...
1
vote
0answers
22 views

Most commented post showing 2 records

I am trying to show the most commented post. Only one post should show but I am getting 2 even though the number of comments is not the same? <?php $args = array( 'orderby' => '...
1
vote
0answers
17 views

Wordpress comments - how to check if comment still needs to be approved?

I created a comments.php template and which contains the following code: <div class="amb-single-comments amb-container-parent override"> <div class="amb-single-comments-...
1
vote
0answers
21 views

Email notification to an email address other than admin for custom type post comments in wordpress

I have a customer post type called video. I want wordpress to send an email notification to one user who is going to check and approve the comments, when ever someone comments on that post type video. ...
1
vote
0answers
67 views

PAIN. Comments Pagination

Sorry for flame, but i wasted 7-12 hours trying to understand how comments pagination works.... Never thought that simple step will take that much with WordPress :'(((( i output comments in my theme ...
1
vote
0answers
20 views

Display only 1 comment and then option to show more

I want to display only 1 comment and then have an option to "show more" to show the rest of the comments. The story behind this is that I've on the homepage a feed with cards for blog posts ...
1
vote
0answers
15 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 = ...
1
vote
0answers
13 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. ...
1
vote
0answers
63 views

Notify post author for a new comment on his post?

I have a "support" post-type(private) where comments are text replies. The member adds a new ticket and the conversation goes with the comments. Currently, everything is normal, but I want to extend ...
1
vote
1answer
198 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
0answers
97 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 ...
1
vote
1answer
35 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
2 3 4 5
11