Loading...
Home Picture
Code

Function to Change Remove #more from URL

Scroll Down

/**
* code #3 - remove #more hash from post URL
* @param string
* @return string
*/
function remove_more_link_jump($post) {
return '<a href="'.get_permalink($post->ID).'" class="read-more">'.'Read More...'.'</a>';
}
add_filter('excerpt_more', 'remove_more_link_jump');

Similar to our last bit, you may have noticed the ‘Read more’ link appends a hash symbol onto the end of your permalink. This is supposed to jump readers down to the paragraph where they ended right before clicking the link. Many webmasters find this annoying, and so here is a quick block of code for turning off that feature.