Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP How to Build a WordPress Theme Converting Static HTML into WordPress Templates Convert Blog Listing and Single Post Templates

Montalvo Miguelo
Montalvo Miguelo
24,789 Points

Theme without comments.php is deprecated

when i used the function <?php comments_template(); ?> i get the following error... how to solve it?? :D

Notice: Theme without comments.php is deprecated since version 3.0 with no alternative available. Please include a comments.php template in your theme. in /Users/ubaldoomana/Desktop/sites/allison.com/wp-includes/functions.php on line 3136

5 Answers

Thiago de Bastos
Thiago de Bastos
14,556 Points

Hey guys I solved it by creating a comments.php file in my theme root dir and copy-pasting the default file from HERE

I had the same issue and figured it out. I enabled comments and got this error because I didn't have a comments.php file in my working theme folder. I just copied the comments.php file from the default twenty fourteen template and pasted it inside my folder. I had a weird message about attributes you can chose to use and had to edit a function to get it to disappear. I removed this line:

<?php comment_form(); ?>

and replaced it with this:

<?php comment_form(array('comment_notes_after' => '')); ?>

That got it working exactly the way I wanted without that notice.

Montalvo Miguelo
Montalvo Miguelo
24,789 Points

Nope only : front-page.php, header.php, footer.php, single.php, page.php, work.php, single-work.php, content-post.php.... the files that we have been working with Zac Gordon ... :)

try to create an empty file called comments.php. see if it works.

Do you have a file called comments.php in your template folder?