Last active
July 26, 2022 12:36
-
-
Save devinsays/15469fd39f7c7b9bdaf4 to your computer and use it in GitHub Desktop.
Query by JetPack Related Posts
This file contains hidden or 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 | |
/** | |
* 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