Last active
September 16, 2018 05:43
-
-
Save RCowles/f53118fa11da23301b5c to your computer and use it in GitHub Desktop.
Move Jetpack's Related Posts
This file contains 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 | |
// Let's unhook the original filter | |
function jetpackme_remove_rp() { | |
$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 ); |
This file contains 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 | |
// Let's add the Related Posts shortcode to our template | |
do_shortcode( '[jetpack-related-posts]'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing. Now it works doing:
single.php