Copy this on your function.php file :
add_filter('comments_open', 'wpc_comments_closed', 10, 2); function wpc_comments_closed( $open, $post_id ) { $post = get_post( $post_id ); if ('post' == $post->post_type) $open = false; return $open; }
This function disable comments on post, you can disable comment on page or custom type content, you should set false on these as well.
Source : https://wpchannel.com/desactiver-commentaires-wordpress/
add_filter('comments_open', 'wpc_comments_closed', 10, 2); function wpc_comments_closed( $open, $post_id ) { $post = get_post( $post_id ); if ('post' == $post->post_type) $open = false; return $open; }
This function disable comments on post, you can disable comment on page or custom type content, you should set false on these as well.
Source : https://wpchannel.com/desactiver-commentaires-wordpress/
No comments:
Post a Comment