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
9
votes
2answers
6k views

Commenting in user profile page?

I am trying to build custom user profile with the guidance of this tutorial: How to make a WordPress profile page I have successfully implemented it to my theme, everything is working well. Now what ...
24
votes
5answers
27k views

How to rearrange fields in comment_form()

Im using a custom filter to change the fields, but can´t figure out how to change the order of the fields in the comment form. Desired order: comment field (first/top) name email website This is ...
10
votes
1answer
5k views

Filtering the Admin Comments List to Show Only Comments from the Current User?

In the Comments page (/wp-admin/edit-comments.php), every logged in user can see all the site comments. I'd like the users to see only his/her own comments and the comments that are left to his/...
7
votes
1answer
3k views

How to enable comments for pending and draft posts?

I have a custom post type with comments enabled. The comments metabox in the admin only appears when the post is published. I'm wanting to use the comments system as more of a discussion between ...
6
votes
2answers
11k views

Paginate result set from $wpdb->get_results()

Is there an easy way to paginate the result set coming from $wpdb->get_results()? I want to get a paginated list of a user's comments on the author_archive page - some of the users of the community ...
6
votes
2answers
5k views

Comment Walker vs. Comment Callback

I've been messing around with custom comments this week and I'm trying to figure out when I'd want to use a walker and when I'd use a callback... There's some things I can't quite figure out how to ...
8
votes
4answers
7k views

Removing the "Website" Field from Comments and Replies?

In an effort to combat comment spam, I'd like to hide or remove the "Website" field from the "Leave a Reply" section for page and site comments. I have no desire to increase others page rankings by ...
3
votes
2answers
244 views

Top Commenters: exclude admin

I'm using the following code in my function.php to display the top commenters in my theme: function top_comment_authors($amount = 5){ global $wpdb; $results = $wpdb->get_results(' ...
32
votes
6answers
36k views

Is there ANY way to remove comments function and section totally?

I don't want any comment querys to run. I don't wont anything about comments to be shown in wordpress admin area. Is this possible in any way? EDIT: Remove all links to the comments from admin bar, ...
21
votes
6answers
7k views

setting comments off as default for pages and custom post types?

I want to turn the comments off by default with pages and custom post-types Initially I simply used conditionals in the comments display function to avoid displaying the block on these pages, but I ...
8
votes
4answers
43k views

Why are the comments disabled by default on my custom_post_types?

I am using a custom post type + taxonomies in a podcast solution for a client. The setting (settings >> discussion) for comments is set to "allow comments". When I add / edit posts under the "posts" ...
8
votes
1answer
17k views

Change HTML Produced by wp_list_comments()

I am developing a WordPress theme for which I would like each comment's timestamp wrapped in in a <span> element for the sake of styling it with CSS rules. However, the wp_list_comments() ...
1
vote
2answers
18k views

Add Comment Custom Field

I searched a lot of thread regarding my problem, but unfortunately I found nothing works, and this my final option. I want to add some custom fields on my comment form. How can I do that?
6
votes
1answer
5k views

How to limit users to one comment per post

I am using WordPress as a petition site and hacking the comments system to work as the petition signup. I would like to find out how I can limit a user to post only one comment per post. So far I can ...
2
votes
3answers
236 views

Can I seperate comments from post?

I have a type of attachments that need full screen display. So, I need to put the comments form somewhere else. How can I tell WP those comments belongs to a post?
3
votes
1answer
14k views

Comment form validation

How can I set the validation rules for the comment field? I change the value of commenter name/e-mail/homepage onmouseover and onblur (I use this instead of labels - so if the field is empty it ...
2
votes
3answers
749 views

Remove link preview in discussion dashboard

It can be sometimes bothersome when, in the Discussion (Comments) dashboard, where the admin can see a list of comments, moving the mouse over a link will cause a preview of that link. Sometimes the ...
1
vote
1answer
221 views

disable comments if array exists

This is the code which is registering the function for rewrite_endpoints(): function wpa121567_rewrite_endpoints(){ add_rewrite_endpoint( 'comments', EP_PERMALINK ); add_rewrite_endpoint( 'stats', ...
0
votes
2answers
498 views

How do you remove the ability for a user to make a comment or post on a page?

I am building a new website on Wordpress, and all my pages have the add comment box at the bottom. I wish fo rthis to be removed from pages such as Home, Contact Us, About etc etc, but want it to ...
0
votes
1answer
176 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 ...
16
votes
5answers
606 views

how to reduce the number of spam comments

I've got the Akismet plugin on my WordPress site but I've been getting more and more spammy comments (that get caught). I'm amazed at the number as the site isn't that popular and doesn't have much ...
3
votes
3answers
2k views

Linking comments from registered users to their profile pages

I am trying to find a way to link the 'username' in comments from registered and logged in users to their profile pages instead of their website URL. And comments from unregistered users to their ...
9
votes
1answer
6k views

Approve comment hook?

I'm looking to send out emails to subscribers when a comment has been approved. The two actions in the Codex are: 1. add_action('comment_post', 'callback', $priority, $accepted_args); Where the ...
1
vote
2answers
1k views

How can I allow editors to leave comments on posts that have not yet been published?

On my NFL football blog all users are allowed to make blog posts. New registrants are given contributor status. When users make a post it is reviewed by an editor, then the editor schedules the post ...
7
votes
2answers
3k views

WP_Comment_Query pagination, delving into the unknown

I am aiming to pagination WP_Comment_Query(). It appears this is either taboo or there is no viable information about it online, not anything. Why? Is it possible? If so, how?
5
votes
2answers
419 views

One comment per user per post but be able to reply to existing comments

I want to restrict my users to be able to comment only once per post but be able to reply to existing comments. How can I do that? I found this code which will do the half trick. With this code the ...
4
votes
2answers
2k views

Get comments for more than one post

I would like to get all the comments for a group of post (not only one post. I tried $comment_args = array('number' => '14', 'post_id' => '10,20,30,40' ); $comments = get_comments($...
3
votes
2answers
1k views

Disable wordpress comments API

We're using the disqus plugin on our wordpress site, so anyone commenting should have a login through disqus. Yet, I'm still seeing spammers trying to post through the regular comments API. They're ...
3
votes
1answer
2k views

Add comments meta fields to comments metabox on post edit screen

I have few custom fields in comment form. How can I add these fields to comments metabox? I divide my question on 3 parts: 1) How to remove url field and add custom comment fields to comment quick ...
4
votes
2answers
23k views

How to display comment form error messages in the same page

I want to display comment form validation errors (as well as captcha error) on the comment form itself and not on a different page. How can I do that?
1
vote
2answers
1k views

count number of user comments with a specific comment meta value

I am using the code below to count the number of comments by a certain user: global $wpdb; $count = $wpdb->get_var( 'SELECT COUNT( comment_id ) FROM '. $wpdb->comments .' ...
9
votes
1answer
693 views

comment_post_ID 0 (cannot remove from dashboard)

Ran across something a bit odd that I haven't seen before. A client has a pretty active blog and uses Akismet (paid) to protect against spam. At least once a day, they're reporting a spam comment that ...
5
votes
1answer
436 views

Writing a plugin that notify my friends of new post that mentions(@) them

For example, I write a new post with content "Today I'm happy, because I finally met the girl that @David told me about bla blah..." Once the post is published, there should be an email notification ...
4
votes
2answers
977 views

What are the current recommended best-practices for comments.php?

I'm getting ready to submit a theme to the .Org repo and wanted to make sure that everything is in ordnung. One of the biggest holes left in my design is the comments template. I've taken a look at ...
4
votes
1answer
5k views

How to add filter in "Comments" at the admin panel?

I found so many information and most of the tutorials only talk about adding filter in post/custom post only. I want to do something similar to this tutorial in 'Comments' area in admin panel. Add ...
3
votes
2answers
2k views

Disable Comments Feed

I am working on a private site where the comments need to be hidden. I know how to remove the comments feed from the header, but can anyone give me some instructions on how to disable the comments ...
3
votes
1answer
3k views

How to remove or replace the log-in link for comment replies?

I need to edit the function get_comment_reply_link() in wp-includes/comments-template.php. All I really wanna do is take out the "log in to reply" text is puts in every comment for logged out users ...
3
votes
1answer
2k views

Can I store my custom comment_type into wp_comments table?

I'm developing a system where a post can have multiple replies/feedbacks. As of now I's storing each of the comments as a serialized postmeta. But just today I figured out that I can use the existing ...
2
votes
2answers
1k views

Getting $comments outside the comment template

I have a ajax request hooked on "template_redirect" (the ajax requests the post's url), and I want to display only the comment template: function get_comm(){ if(isset($_GET['get_my_comments'])): ...
2
votes
2answers
2k views

Update post date on every new comment?

I would like to update a post on every new comment, so that the Last Modified Date is always up to date on the sitemap. How can i do this? Thanks.
1
vote
2answers
2k views

Custom Field Added In Comment Form Not Showing In Edit

This is my code in functions.php for adding the custom field in comment form add_filter( 'comment_form_default_fields', 'add_phonenumber_field' ); function add_phonenumber_field($fields) { $...
0
votes
1answer
65 views

how to make author to write comment on only his own posts?

i want restrict my registered authors to write comment to other posts except his own posts. Is it possible? I have no idea how to do it. May be need conditional logic but how?
2
votes
1answer
929 views

Exclude post_type from admin comments_list

I'm trying not to show comments from a certain custom post type int the comments list on the admin interface. I went to the "wp-admin/includes/class-wp-comments-list-table.php" and tried to play with ...
2
votes
1answer
1k views

Can't add default comments to custom post type

I am trying to add defualt comments to my custom post type. I have added to my supports argument: 'supports' => array('title','editor','thumbnail','tags','post-formats','comments','revision'), I'...
2
votes
1answer
690 views

"Leave a comment" link even when you can't

On http://wordpress.barrycarter.info/index.php/page/7/ I disabled comments for "USDCAD options vs CADUSD options arbitrage?", but it still has a "Leave a Comment" link. Clicking the link takes you ...
2
votes
1answer
897 views

Allowing logged in users to comment without moderation across a multisite installation

I currently do web admin for an internet community based on BuddyPress and Multi Site, and use the Comment author must have a previously approved comment setting to make it easier for users to comment ...
1
vote
1answer
568 views

Change comments form title on a page by page basis

I'm looking to change the comments form title (my theme defaults this to "Leave a Comment" or "Leave a reply to"). I thought perhaps I could add a hook to comment_form_defaults but my snippet below ...
0
votes
1answer
37 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', '...
0
votes
1answer
45 views

I have tried using Plugins to remove 72K comments with no success

I have tried a lot of plugins that say they will remove all the comments with NO luck. I am still showing a number of 72,037 comments, but I no longer can see the actual comments themselves. And, it'...
0
votes
1answer
376 views

Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins

I'm trying to adjust the comments screen for non admins to my project. Right now I'd like to disable Quick Edit | Edit | History | Spam under any comment left for any post created by the user. ...