Skip to content

Instantly share code, notes, and snippets.

@wpspeak
Created September 26, 2015 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpspeak/97409a9c0dc1069552a8 to your computer and use it in GitHub Desktop.
Save wpspeak/97409a9c0dc1069552a8 to your computer and use it in GitHub Desktop.
Remove Jetpack Related Posts on Custom Post Types
<?php
//* Remove Jetpack Related Posts on THEMES CPT
function afn_jetpack_archive_no_related_posts( $options ) {
if ( is_post_type_archive( 'themes' ) ) {
$options['enabled'] = false;
}
return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'afn_jetpack_archive_no_related_posts' );
//* Remove Jetpack Related Posts on THEMES Single Page
function afn_jetpack_singular_no_related_posts( $options ) {
if ( is_singular( 'themes' ) ) {
$options['enabled'] = false;
}
return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'afn_jetpack_singular_no_related_posts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment