The comments_open()
function is used, both by core and typically themes to determine status for specific post. It has filter of same name for result, which you can use to manipulate it individually for the post.
comment_form()
won’t actually output form if check is false and fire comment_form_comments_closed
action in such case.
Native WP themes, shipped with core, are also good examples of building this check into templates.
Related Posts:
- How do we remove the H3 tag for the reply-title I.D
- Success message in comment form
- Using filter to add additional fields to comment_form()
- How to add a div on comment fields / edited
- How to modify comments form using comment_form()?
- Comment form problem with comment_author_url and HTML5 input placeholders
- stackexchange-like submit comment window
- WordPress custom form action url
- After Submitting Comment Form Shows an Empy Page in WordPress
- Spammers attacking my WordPress Site – Removing URL field from core? [closed]
- How to hide wordpress post comment form for specific role
- Copy and Paste Password for Comments
- How t Remove Labels from comment Box
- comment form code redirect to wp_comments_post.php with blank page
- Need to output comment_form() function inside a foreach loop
- How add custom text under comment form
- Delete comments function
- Image Upload Form is Disabling Comment Addition
- Comment submission & navigation redirects to default language
- Reply to a specific comment?
- How to hide the login / profile urls on top of comment box for a post
- How to use a custom comments template
- Comment visibility
- Get comments for more than one post
- “Categories” for comments?
- Allow anonymous comments, but prevent spam [closed]
- Where to remove from comment’s feed?
- Allow guests comments on single post
- Delete all user comments
- Why do I get email notifications about comments that WordPress has already determined are spam?
- Delayed commenting
- “Leave a comment” link even when you can’t
- An action hook where a comment meta is updated
- Display number of comment replies
- User can post only one comment per day on one page
- Last comment page first with full number of comments?
- Only subscriber role user can comment not other
- customize comment form
- Relaxing unescaped HTML filtering inside tags?
- How to get the result of comments_number() as a string instead of printing it out?
- Should I still worry about paginated comments with the latest wordpress versions?
- How to dont allow registered users to comment without being logged in?
- edit comments capability for authors
- Publish a message on facebook after having posted a comment
- Users with custom roles can’t read each other’s comments
- Why is_wp_error() is not returning false even there’s no defined error
- wp_insert_comment and security
- How can someone submit a comment when my site has no comment field?
- Separete trackbacks/pings and numbered comments
- How can I fix wp_insert_comment failure when ‘comment_content” includes slanted apostrophe in Excel csv source data
- Show comments in a popup
- How to display html in only the first level of WP comments?
- Set noindex page-comment from Pages 2, 3 and More?
- How can I convert anonymous commenters into registered users?
- your comment awaiting moderation message sometimes not appearing
- Limit comments per user per post
- Filter In Reply comments from WordPress Admin Panel
- WordPress ‘comment counts’ got messed up, because of a plugin – DISQUS
- blank page after submitting a comment
- Remove post navigation links
- Notify post author for a new comment on his post?
- cancel reply link results in 404 error
- css hide all the comment reply links except the lowest nested comments
- Which filter/hook to use for styling comments?
- How should I get the original comment while processing the reply
- I wish to remove, disable or hide the comment authors’ links to their sites from my home page
- Admin can enter JavaScript – potential security risk?
- How to stop ultimate members to redirect comment authors to user profile?
- Replace comments with a dummy text
- How do I stop the comments going to my email?
- 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
- How to create post comment from different domain
- Display custom text when comments are closed
- I need to disable Disqus comments pre-approval, but i can’t find where
- JetPack comment threads are displaying above comment box? [closed]
- Page comes up blank using w3 total cache [closed]
- Comment Table Size Results in Slow Page Loads and 500 Errors
- Insert ads between comments
- get_query_var(‘paged’) for WP_Comment_Query always return 1 when using paginate_comments_links()
- How to show username in reply to comment?
- Custom sort comments with select form
- Limit Comment Line Count – Add Read More Button
- Commenter username copies author username
- Fire Social Annex Code on Comment Approval
- Displaying comment rating stars in carousel
- Enable comments option
- Change Comment Text [duplicate]
- Comments closed but enabled on edit screen
- Let user delete comment on front end only
- jQuery to Create Button to Show/Hide WordPress Comments and to Hide Comments by Default
- Auto approve all comments (editor)
- add field comment [duplicate]
- Let users comment on categories in WordPress
- Loop not displaying comments_popup_link
- Display of comment_date within get_comments?
- Customize comment notification e-mails with HTML
- prevent duplicate comments using wp_insert_comment
- Add ACF Quick Edit Columns on Comments