Created
September 26, 2015 12:27
-
-
Save wpspeak/97409a9c0dc1069552a8 to your computer and use it in GitHub Desktop.
Remove Jetpack Related Posts on Custom Post Types
This file contains 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 | |
//* 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