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

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?