Add this code at the end of your functions file or template to open comments.
Works in any theme.
If you enable comments on pages & posts, you may need to manually enable them on the Edit Post/Page screen. Using this code, the comment form on all posts or pages are enabled.
The download folder contains 3 code snippets all of which you can use to enable or disable comments on posts and/or pages including custom post types.
Global Use
To enable the comment form on all pages, you would need to add the code to your functions file.
If you add the code to an archive type template like category, tag, archive or search, it won’t enable the comment form on all pages. It will enable other functions like the [post_comments] shortcode to run which will enable the comments link for specific archives but not the comment form.
This enables you to run functions which use conditional if statements with genesis_get_option( 'comments_posts' )
and/or comments_open()
.
Close Comments
You can also use any of the code snippets to close comments globally. Simply change true too false in any of 3 code snippets.
Leave a Reply
You must be logged in to post a comment.