WordPress 4.3 及后续版本将页面(page)的评论功能默认关闭了,也就是说,你如果新建页面,需要手动勾选”允许评论”才可以开启页面的评论功能,这个对于经常要发布可评论页面的用户来说,无疑增加了操作量。
如果你想要默认开启页面的评论功能,那你可以下载安装 Allow Comments on Pages by Default 插件,或者将下面的代码添加到主题的 functions.php 即可:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | /* Plugin Name: Allow Comments on Pages by Default Plugin URI: http://wordpress.org/plugins/allow-comments-on-pages-by-default/ Description: Turns on comments on pages in WordPress 4.3+ by default. Author: Sergey Biryukov Author URI: http://sergeybiryukov.ru/ Version: 1.0 */ function wp33516_open_comments_for_pages( $status, $post_type, $comment_type ) { if ( 'page' === $post_type ) { $status = 'open'; } return $status; } add_filter( 'get_default_comment_status', 'wp33516_open_comments_for_pages', 10, 3 ); |
/* Plugin Name: Allow Comments on Pages by Default Plugin URI: http://wordpress.org/plugins/allow-comments-on-pages-by-default/ Description: Turns on comments on pages in WordPress 4.3+ by default. Author: Sergey Biryukov Author URI: http://sergeybiryukov.ru/ Version: 1.0 */ function wp33516_open_comments_for_pages( $status, $post_type, $comment_type ) { if ( 'page' === $post_type ) { $status = 'open'; } return $status; } add_filter( 'get_default_comment_status', 'wp33516_open_comments_for_pages', 10, 3 );
到此这篇关于WordPress 4.3+ 默认开启页面的评论功能就介绍到这了。遇顺境,处之淡然,遇逆境,处之泰然。更多相关WordPress 4.3+ 默认开启页面的评论功能内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!