I'm trying to change the function of the read more button on the excerpt of a post. Instead of the Read More button going to the article page, I'd like it to load the rest of the article on the archive page.
This is what I have in my functions page:
function new_excerpt_more($more) {
global $post;
return '... <a href="'. get_permalink($post->ID) . '">Read more</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
function custom_excerpt_length( $length ) {
return 250;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
I know that I'd have to replace get_permalink($post->ID)
with something else, but I'm not sure how to go about it. Any help would be greatly appreciated.