Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Query by JetPack Related Posts
<?php
/**
* Prevents Related Posts from displaying in content area
*/
function prefix_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', 'prefix_remove_rp', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment