How can I edit the Twenty Ten Theme to remove the comments box when a page uses a specific template?

I’m new to WordPress and I’m trying to edit the Twenty Ten theme so that my template for basic pages (basic-template.php) does not show the comments box. I do want the comments box to show up on other pages, such as blog posts. I’m pretty sure that changes need to be made in loop.php, but my doesn’t seem to be having the right effect. For the comments box, I edited:

<?php comments_template( '', true ); ?>

to be as follows.

<?php
wp_reset_query();
if ( is_page_template(‘basic-template.php’) ) {
comments_template();
} else {
comments_template( '', true );
}
?>

When I get rid of the else statement, the comments disappear, so I think the problem is my code for that part. Any advice would be much appreciated!

2 Answers
2

You can turn off the discussion per post/page when you’re creating new posts/pages. this option is usually below the text editor and is often hidden. In order to bring it up, you might have to click on “Screen Options” at the top of the page and check the box next to “Discussion”

Leave a Comment