• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Open Comments On All or Any WordPress Post Type Globally

Add this code at the end of your functions file or template to open comments.

Works in any theme.

Click here to access free tutorials

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 snippet to close comments globally. Simply change true too false in any of 3 code snippets.

Comments

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems