Hybrid – Disable Comment on Page

We don’t really want comment section on our pages. Using hybrid, we can disable all comment on page. First, create an empty file called no-comment.php (or any name you want to use). Add this code to functions.php file:

add_filter( 'comments_template', 'remove_comments_template_on_pages', 11 );
function remove_comments_template_on_pages( $file ) {
if ( is_page() )
$file = STYLESHEETPATH . '/no-comments.php';
return $file;

That’s all.

Tags: ,

One response to “Hybrid – Disable Comment on Page”

  1. Andy Teh says :

    Work great! Thank you, Eric.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: