Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Make a Website with WordPress Customizing WordPress Themes Customizing WordPress Theme Files

shareyourpeace
shareyourpeace
3,244 Points

When I comment out the php code to remove comments, the comment_template (); the comment text box is still visible.

In page.php,

<?php // comments_ template();  ?>

But the comment text box is still visible.

I then deleted the entire line of code but the comment text box is still visible.

2 Answers

Pol Martin
Pol Martin
8,200 Points

Hi there,

if you removed the whole line and comments still appear, it is most likely that page.php is not the template used for this particular case.

It may be using a more specific template instead of the generic page.php

Check the Wordpress Codex for more info about Template Hierarchy:

http://codex.wordpress.org/Template_Hierarchy

shareyourpeace
shareyourpeace
3,244 Points

Thanks Pol. I will try this.

Josh Lipton
Josh Lipton
13,255 Points

I had the same problem. I was able to apply the edit to the file single.php to get the comments to stop showing.