Good news, bad news..
Good news
The logic behind it is really simple. You basically wrap the form inside of a simple if statement.
if(condition){
/*Your form here*/
}
else {echo '<h4>You need to be a premium account to post comments</h4>';}
Bad News
You’ll need to code in another user role. This can usually be done via a plugin. Most plugins offer documentation on how to check for a user’s user-role.
So if the plugin has a function like
get_user_role();
You’d simply place that as your condition. That would look something like this:
if(get_user_role() == 'premium'){
/*Your form here*/
}
else {echo '<h4>You need to be a premium account to post comments</h4>';}
Related Posts:
- how to make author to write comment on only his own posts?
- Why are authors allowed to approve comments on their posts? How to revoke privilege?
- How to change the email notification recipient (user) for new comments?
- Change Comment Author Display Name
- Check If comment author is registered
- Comment Author Name In Reply Form
- Display all comments or recent comments per user on author page
- Add a drop down list to comment form?
- Prevent Contributor to show comment list
- Expanding the allowed HTML tags in comments?
- How to check if commenter is the_author?
- Let user edit his own comment
- Capability for allowing user to post own comments without moderation
- edit comments capability for authors
- Why do comment moderators need to have all create/edit/delete toboth posts and pages?
- How to allow a particular role like Contributor be able to only view pending comments and approve them?
- Users with custom roles can’t read each other’s comments
- Hide notifications regarding new comments
- List user comments in author page
- Author can only see own post comment and can moderate
- WordPress comments on users profile
- Comment displaying full name even after setting another display name?
- Same email for all comments
- Notify post author for a new comment on his post?
- Show comments of a user post only when they are login
- Grant a person permission to moderate all comments on a blog without giving them the ability to edit other peoples post
- How many members have made comments approved for an article?
- Commentlist: bypostauthor problem with children list
- get_comment_author_link not working properly
- Get Comment Author ID on the fly while posting
- Show image next to the comment author if have certain role
- Is there a way to only allow certain user ranks to comment on a post
- How can I hide comment of the authors from their published posts?
- WordPress Custom Local Avatar not showing in comments
- Attaching author tag to the comment
- How to prevent users/authors from seing IP/email of new commentators?
- Author name length character limit?
- Comments counter only for Authors Posts
- Showing different images depending on user role
- Why the capability ‘activate_plugins’ is needed to allow a role to see all posts/pages/comments?
- Comments pagination on author page
- Change author, disable comments, enable trackbacks for all items in library
- Prevent author from editing comments from others in their post
- URLs to user page is broken
- Listing comment author role code problem
- How to ‘If Author’ Comments Check
- Auto approve all comments (editor)
- Filtering the Admin Comments List to Show Only Comments from the Current User?
- Non-threaded comment replies with link to original comment
- When importing – failed to import: Invalid post type feedback
- Deep customization of the comment form?
- How to hide “Trackback” on paginated comments
- Comment form not showing up without comments
- How to show Disqus comment count number only without text?
- how to have 2 comments_template() in one post
- Display the number of user comments
- How to Delete Old Comments by Date?
- How to hide “Comments are disabled”
- WordPress comments just vanished even tho there are about 250+ of them. Where did they go?
- Restore trashed posts with comments
- How to import only certain comments from post[s]
- Make wordpress comments work with include templatepath
- Sort/list/arrange comments by comment author in un-nested/no thread comments
- Archive comment w/o moving to spam/trash
- Get the top level comment ID
- Custom WP Comments Query with Nested Comments Possible? (Hierarchy/Depth)
- Log file reports SQL Error processing child comments
- Get Post ID within wp_set_comment_status hook
- get_comments not working consistantly with post_id
- Comments are invisible, what’s the problem with wp_list_comments?
- WP confusing “links to my articles” with “comments”?
- How to check if a comment has replies?
- Safe to remove this: when using a 3rd Party Comment App? [closed]
- How do I disable the discussion notification emails to us when a comment is “approved” and when an adiministrator replies?
- Review count per product
- Moving post’s content to post’s comments section
- Advanced Custom Fields comments [closed]
- How to wrap comment_form $fields in one div?
- Two textareas showing up in comments.php
- how should the comment form really work?
- create separate page template for wordpress comments
- Styling Admin comments in WP 3.1.3
- How to rename/change the comment labels in WordPress backend?
- Edit Comments Fields
- Random output of comments using a shortcode
- Upload avatar for post comment
- Custom author url and page for another role
- Comments stuck inside post edit, but not showing under the published posts
- How add custom text under comment form
- Can’t hover on Submenu
- Can I allow registered users to comment without being logged in or having to be approved?
- How to require users not to be logged in for comments on single page only?
- How to create a designated comment page with custom fields
- WordPress shows admin’s avatar after editing a comment
- change text written in english into hindi
- comment-reply.js always focuses on comment textarea
- Why might a comment turn red on approval?
- Reply to a specific comment?
- WordPress comment pagination : newest comments on first page
- How to make comments reply work in my website?