When creating child themes for Twenty Ten default WordPress theme (which is also a theme framework) there are some minor issues we need to take care off for a better usage. For example when creating a static page usually we do not need comments and pingbacks to be enabled, however, comments are by default enabled and we need to remember when creating a page to switch off comments and pingbaks. But there's an easy way to fix this issue by adding few lines of codes in the child theme functions file.
Tu turn off the default comments and pingbacks you need to edit the functions.php of your child theme (works for any other regular WordPress theme as well) and add this:
// Turn off comments and pingbacks by default for pages
function default_comments_off_for_pages ( $data ) {
if( $data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' ) {
$data['comment_status'] = 0;
$data['ping_status'] = 0;
}
return $data;
}
add_filter( 'wp_insert_post_data', 'default_comments_off_for_pages' );
Now if you want to have comments enabled in your static page you will have to check "Allow comments" manually.
This function is added to all Twenty Ten Child themes from WPshed so if you want to see the function live just download one of the themes.




