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 Custom Post Types and Fields in WordPress Custom Post Type Templates

Enabling comments on custom posts

I'm having problems with enabling comments on the single-art.php page. I can get comments appearing on the art.php page (via the standard page settings). Checking the comments option when creating the custom fields hasn't helped either and the comment code does exist in the PHP file. Any help appreciated! Thanks

Matt Campbell
Matt Campbell
9,767 Points

Hi,

Have you added comments support to the custom post type?

If you look here: https://codex.wordpress.org/Function_Reference/register_post_type and scroll down about three quarters, you'll see an example where they've added 'comments' as one of the array values in the supports part of registering a post type.