Funny the large majority of people for years wanted this functionality removed, but I would reference this as you can probably use some of it to turn that functionality back on for pages pretty easily. Hope this helps.
https://make.wordpress.org/core/2015/07/06/comments-are-now-turned-off-on-pages-by-default/
Thanks for the lead Will
so this code would go in the functions.php file…
/**
* Filter whether comments are open for a given post type.
*
* @param string $status Default status for the given post type,
* either 'open' or 'closed'.
* @param string $post_type Post type. Default is <code>post</code>.
* @param string $comment_type Type of comment. Default is <code>comment</code>.
* @return string (Maybe) filtered default status for the given post type.
*/
function wpdocs_open_comments_for_myposttype( $status, $post_type, $comment_type ) {
if ( 'myposttype' !== $post_type ) {
return $status;
}
// You could be more specific here for different comment types if desired
return 'open';
}
add_filter( 'get_default_comment_status', 'wpdocs_open_comments_for_myposttype', 10, 3 );
but what would I need to change ‘myposttype’ to for a custom page template?
thanks
(@mattias01)
10 years, 7 months ago
Hi all
I’m relatively new to WordPress and trying to figure this issue out
I want comments to be automatically enabled on a custom page type.
I know you can toggle this on the page entry form, however there is a chance the client will miss this when they are creating new pages.
I’ve tried selecting the setting ‘Allow people to post comments… ‘ in discussion settings; which works for posts, but it doesn’t seem to work for my custom page template.
Any ideas?
thanks kindly