How can I add comments to a page?

How can I allow people to post comments on a page? I’ve put this into my page template: <?php comments_template(); ?> but it just says at the bottom of my page “Comments closed”. UPDATE: If I can allow comments for one specific template for a page that would be great. Answer Have you checked under … Read more

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($comment_args); foreach($comments as $comment) … But does not work. Any ideas? Answer The ‘post_id’ is converted to a positive integer in WP_Comment_Query, so you cannot … Read more

Reverse comment pagination numbers

I would like to reverse the comment pagination numbers so that the newest comments show on page 1 instead of the last page. I did an array_reverse for the comments_array and set the WordPress Discussion Settings to first page displayed by default – everything works fine except when someone leaves a comment it doesn’t take … Read more

What’s the easiest way to close comments on media/attachments?

I consistently get spam attempts on various and sundry media attachments on my primary WP blog. By default, media has open comments (for instance, http://literalbarrage.org/blog/archives/2009/03/18/daddywill-date-march-2009/dsc08760/), yet there is no native way to disable comments on media files. (e.g. https://skitch.com/zamoose/rhktp/attachmentedit) So, two questions: How do I disable all comments for future uploads by default? How do … Read more

How to add internal, revision comments to page updates

I’m not sure the proper WP parlance for this, but I’d like to add historical comments to submitted page updates for version control purposes or as a supplement to the Revisions Browser. (Something like an additional page attribute to be seen when browsing through historical versions of a page.) EXAMPLE: Modify page content Enter internal … Read more

Comment visibility

There will be many people commenting on a post. So, when a commentator visits the post, he should be able to see ‘only’ his own comment(s).Post author can see all comments only on his own post. How can I do this in WordPress? Answer By using the ‘pre_get_comments’ action, found in wp-includes/comment.php: function restrict_visible_comments( $comments_query … Read more

How to use a custom comments template

My wordpress makes use of custom post templates. I’m now trying to create a custom comments template as well. I noticed that the comments template is called via this function <?php comments_template( ”, true ); ?> I checked in my functions.php and comments.php but don’t see the function being declared anywhere. Can someone please advise … Read more

Disable saving comment details (name, e-mail) in cookie?

The European Union has introduced a directive requiring that websites obtain permission for setting all ‘non-essential’ cookies. In the UK (where my site is based), the appropriate detail is explained by the ICO. As I understand it, with a ‘vanilla’ WordPress site the only cookies set are: Those for logged in users to allow administration, … Read more

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 sent to David about this post that mentions him. Is there already such plugin? If not please help me … Read more