patric-boehner
3/31/2016 - 2:25 PM

Read More outside the paragraph

Read More outside the paragraph

<?php
//don't include this 

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

 * Break more link outside the paragraph in the loop on all archives (home, archives, search, etc)
 
==================================================================================== **/        
function yourprefix_excerpt_more_link() {

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

	//New excerpt
	function get_read_more_link() {
		$excerpt = get_the_excerpt();
		return '<p>' . $excerpt . '&nbsp;...&nbsp;</p> <p class="your-class-goes-here"><a href="' . get_permalink() . '">Read&nbsp;More</a></p>';
	}
	add_filter( 'the_excerpt', 'get_read_more_link' );
	
}
add_action( 'after_setup_theme', 'yourprefix_excerpt_more_link' );