Last active
December 18, 2018 07:03
-
-
Save adamlaki/d28c3207bc29d9f1f22402fea001e3e1 to your computer and use it in GitHub Desktop.
Remove Jetpack Related Post from Custom Post Types
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 pine_jetpack_archive_no_related_posts( $options ) { | |
if ( is_post_type_archive( 'product' ) || ( get_post_type() == 'product' && is_single() ) ) { | |
$options['enabled'] = false; | |
} | |
return $options; | |
} | |
add_filter( 'jetpack_relatedposts_filter_options', 'pine_jetpack_archive_no_related_posts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment