Last active
August 29, 2015 14:17
-
-
Save besimhu/4f00826ba33884692d35 to your computer and use it in GitHub Desktop.
Sometimes you want to use the <-more-> tag to link to the full post. That being said, the only problem with that is that it jumps to the part where the tag was added. Here a function that removes the jump.
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
// Remove jump with <-more-> tag | |
function remove_more_jump_link($link) { | |
$offset = strpos($link, '#more-'); | |
if ($offset) { $end = strpos($link, '"',$offset); } | |
if ($end) { $link = substr_replace($link, '', $offset, $end-$offset); } | |
return $link; | |
} | |
add_filter('the_content_more_link', 'remove_more_jump_link'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment