Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@devinsays
Last active July 26, 2022 12:36
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devinsays/15469fd39f7c7b9bdaf4 to your computer and use it in GitHub Desktop.
Save devinsays/15469fd39f7c7b9bdaf4 to your computer and use it in GitHub Desktop.
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