Disabling the Carousel commenting of WP Jetpack

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:


<?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 );
?>

view raw

functions.php

hosted with ❤ by GitHub

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.