Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active June 26, 2016 01:41
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 neilgee/343ae05fbfdbd02cc083 to your computer and use it in GitHub Desktop.
Save neilgee/343ae05fbfdbd02cc083 to your computer and use it in GitHub Desktop.
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