Skip to content

Instantly share code, notes, and snippets.

@neilgee neilgee/jetpack.php
Last active Jun 26, 2016

Embed
What would you like to do?
JetPack Related Posts
<?php // <~ Remove the opening PHP tag
// Ref - https://jetpack.com/support/related-posts/customize-related-posts/#delete
// Remove JetPack Related Posts
function jetpackme_remove_rp() {
if ( class_exists( 'Jetpack_RelatedPosts' ) ) {
$jprp = Jetpack_RelatedPosts::init();
$callback = array( $jprp, 'filter_add_target_to_dom' );
remove_filter( 'the_content', $callback, 40 );
}
}
add_filter( 'wp', 'jetpackme_remove_rp', 20 );
//reposition JetPack Related Posts Somewhere else
function wpb_jp_posts() {
echo do_shortcode(' [jetpack-related-posts] ');
}
add_action( 'genesis_entry_footer', 'wpb_jp_posts', 15 ); //use required hook for position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.