Force a Read More Link on all Post Excerpts in WordPress

Can’t see a read more link on a WordPress post on the blog page?  The read more link can be forced on all excerpts for posts on an archive page by adding the following code to your theme. Sometimes the read more wont show due to a shortfall of characters or an element like an iframe sitting at the top of the post.

//Read More Button For Excerpt
function themeprefix_excerpt_read_more_link( $output ) {
	global $post;
	return $output . ' <a href="' . get_permalink( $post->ID ) . '" class="more-link" title="Read More">Read More</a>';
}
add_filter( 'the_excerpt', 'themeprefix_excerpt_read_more_link' );

Just pop this into your functions.php and you should be golden!

You can add CSS class and HTML to suit in the return values. In the example above a .more-link CSS class is applied and the title attribute has a value applied to it.

To set up differing ‘read more’ text based on if a post belongs to a certain category such as ‘view more’ you would need to use the function surrounded by conditionals – example below