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

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Display Message on Posts With Closed Comments

In the WordPress Dashboard, you can go to Settings > Discussion > Other comment settings > Automatically close comments on articles older than …. days.

comment-settings

This will remove the comments form on single posts when comments are closed however the comments will continue to display.

You can also use the single post settings in any Edit Post screen to disable comments on a post by post basis:

turn-off-comments

This setting won’t remove the comments, only the comments form.

If you want to display a custom message in replace of the comments form only on posts where comments are disabled, here’s the code to do that.

Register for full access

You can use any of the following genesis hooks for comments:

do_action( 'genesis_before_comments' );
do_action( 'genesis_comments' );
do_action( 'genesis_after_comments' );

do_action( 'genesis_before_pings' );
do_action( 'genesis_pings' );
do_action( 'genesis_after_pings' );

do_action( 'genesis_before_comment_form' );
do_action( 'genesis_comment_form' );
do_action( 'genesis_after_comment_form' );

Related Code Snippets

  • Submit Button Notice for WooCommerce Product Reviews

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.