Try this, the code below will generate every comment by the $current_user->user_email
for the author_email, if the $usercomment
return something, then there is a comment by the current user so echo “thank you”, but if it’s not return anything output the form.
global $current_user,$post;
$usercomment = get_comments(array('author_email' => $current_user->user_email, 'post_id' => $post->ID));
if($usercomment) {
echo "Thank You";
}
else {
comment_form();
}
Related Posts:
- Email entire post contents
- How to make comments work for a post loaded per Ajax?
- Allow variable amount of comments before pagination
- Sends out email to admin
- get comments and get posts in loop
- When a user creates a post (pending), send a confirmation link that allows them to publish
- How to display comments and comment form on custom post type?
- Comments are assigned to wrong or related post
- How can I allow editors to leave comments on posts that have not yet been published?
- Update post date on every new comment?
- Can’t show comments count per post outside loop
- Only display posts with comments
- Comments enabled, but disabled at the same time
- Comments not showing in custom post type – WordPress
- How to output comments number of a post per day?
- Enable commenting on front-end preview page for pending posts
- Hide comments awaiting moderation from user who submitted the comments
- Custom function for “Submit for Review” hook
- Send email to user that his post has been rejected
- Posting via email, where do I start troubleshooting?
- How do I allow users to follow a post and then allow admins to email all users who have followed that post?
- Hide Post comments when displayed via WP_Query
- Including new Javascript only after a comment is made
- Disable Post/Page comment emails for creators
- Display posts with comments closed, with pagination?
- Why is WordPress redirecting users to random posts after commenting?
- How to get most recent commented post above new submitted post in WordPress?
- When trashing a post, also trash related comments
- how to find user ids of all commenters in a post
- Diplay comment date on WP_Post_Comments_List_Table
- Posts vs. Pages
- count the total number of comments the user has received for his published posts
- How to Orderby Comments by post title?
- Receive each week the number of posts published
- If modified on same day, show only time
- How to allow logged in users to post anonymously
- Query get post,how to add comment box
- Update all comments time to random dates?
- Enable Comments Box On Custom Post Type
- Turn On Comments On Custom Post Types in Directory Theme
- Emojis replaced by ‘?’ automatically
- Move comments only from one WP installation to another
- Second comments section for one post/page
- A friend wants to make a comment on one of my articles, she has to be logged to wordpress?
- Get all images in post and comments like Twitter before post title
- Is it possible to paste a link without tags and make it directly a link in a post?
- Showing author page if user has no post
- Customizing Comments on Posts
- WordPress Comment posting problem
- What do comments with […] mean?
- What do these phpMyAdmin errors mean on my WordPress databaes?
- Internal post link creates comments on its own
- How to get posts and comments amount per hour, per year and per month?
- Show comment number per author per day
- Get all comments of author’s posts
- Send a review notification email to admin when a post is 12 months old
- SQL Command for restoring trashed comments
- Howto show comment count by post in post?
- How do you change the comment count in the back end posts list, to reflect unapproved comments, rather than all comments?
- New Gmail email to a WordPress new post? [closed]
- Hide comments and posts posted by other user
- Let both the admin and post author update comment meta
- How to style archive post titles… but only those posts who have comments?
- Send email for pending post
- Is it advisable to use $post->comment_count instead of get_comments_number( $post_id )
- How does WP decide how to display a page
- Send email to author of post on post submission
- Display on page every post in blog WITH comments
- Showing recent post of category in page
- Can WordPress handle following functionalities?
- If post exists, make it a comment in existing post with same name?
- How to get post id of last approved comment?
- WordPress Post via e-mail writes a random string for the post body
- How to implement a WordPress comments function?
- Allow / show post comments in category pages
- Count the total views of all user posts published
- how to show comments only author which send own posts in wordpress
- Shortcode for Comments and Comment Boxes in Post Loop
- Merge get_comments & get_posts into a single query
- How to Best Create Separate Subscribers and User Experience
- Remove the URL author of post on all comments
- WordPress weird behaviour on comments
- Comments are in database, don’t show up in WordPress backend or frontend
- No comments allowed
- I want to change the WordPress comments file
- Post by Email – Shortcode for Language? [closed]
- Posting a comment redirects admin/users to blank page
- How to enable comments meta box for other author posts?
- Comments as part of a post
- Some comment box wordpress in 1 post [closed]
- No comments on static front page
- 3rd Party Login in wordpress
- Trash a post, send associated comments into the trash bin (change status)
- Apply comment to different post (not the current post) [duplicate]
- How can I get a comment ID on Submit?
- External link not showing on post but showing on comment
- Get first comment link on the post itself
- Get url/link to latest comments in a post
- Display only posts with comments
- wp_query select if have comments