carasmo
2/23/2016 - 6:21 PM

Force the read more link on excerpts even if the content is below the threshold and even if it's a custom excerpt.

Force the read more link on excerpts even if the content is below the threshold and even if it's a custom excerpt.

<?php
//don't include this 

/** ====================================================================================

 * Force read more link to all excerpts whether or not it meets the word length criteria 
 * and whether or not it is a custom excerpt
 
==================================================================================== **/        
function excerpt_more_link_all_the_time() {

	// Remove More Link from get_the_excerpt()	
	function more_link() {
		return '';
	}
	add_filter('excerpt_more', 'more_link');

	//Force read more link on all excerpts
	function get_read_more_link() {
		$excerpt = get_the_excerpt();
		return '<p>' . $excerpt . '&nbsp;...&nbsp;<a href="' . get_permalink() . '">Read&nbsp;More</a></p>';
	}
	add_filter( 'the_excerpt', 'get_read_more_link' );
	
}
add_action( 'after_setup_theme', 'excerpt_more_link_all_the_time' );