WordPress: How to enable comments on *pages* by jgn on Sunday, September 23, 2007 in Technology

I needed to turn on comments on WordPress pages (as opposed to just blog posts) for my course blog.

Here's how to do it:

Find your theme's page.php. Then inside "the loop" (if (have_posts(), etc.) you need to add a call to comments_popup_link. This provides the display of the number of comments (if any) and the link to the comments section or the popup, as appropriate. In my page.php, it looks like this: [source language='php']

[/source] Then go to wp-includes/comment-template.php, and find [source language='php'] if ( is_single() || is_page()) [/source] Remove the check against is_page(), i.e., [source language='php'] if ( is_single() // || is_page() ) return; [/source] That is all. Once this is done, page comments go into the comments feed as usual.

comments powered by Disqus