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!
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”
I could have interpreted badly your intentions but shouldn’t your code be: