Jetpack is one of the best plugin to add to your site because of its cool features packed in one plugin. One I mostly use is the image carousel to easily add a lightbox popup in your gallery page but it has a built in commenting that you cannot disable from any of the built it options available.
You can quickly disable it by adding this snippet in your theme’s function.php file:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function jetpack_carousel_disable_comment( $jpimages, $postid ) { | |
| $posts = get_post( $postid ); | |
| if( $posts->post_type == 'attachment' ) { | |
| return false; | |
| } | |
| return $jpimages; | |
| } | |
| add_filter( 'comments_open', 'jetpack_carousel_disable_comment', 10 , 5 ); | |
| ?> |
