Reply To: Having Trouble with showing the "Keep Reading" Link

#20323
moraitis
Participant

UPDATE
For my child theme I used the following code to stylize the excerpt ending.

// Remove Functions We Want to Replace
function child_theme_setup() {
	// override parent theme's 'more' text for excerpts
	remove_filter( 'excerpt_length', 'enlightenment_excerpt_length' ); 
	remove_filter( 'excerpt_more', 'enlightenment_excerpt_more' ); 
}
add_action( 'after_setup_theme', 'child_theme_setup' );

//set the length of the excerpt prior to the read more link
function md_enlightenment_excerpt_length( $length ) {
	if( is_singular() )
		return 100;
	if( doing_action( 'enlightenment_after_header' ) )
		return 100;
	$grid = enlightenment_get_grid( enlightenment_current_grid() );
	if( 3 == $grid['content_columns'] )
		return 50;
	if( 4 == $grid['content_columns'] )
		return 50;
	return 100;
}
add_filter( 'excerpt_length', 'md_enlightenment_excerpt_length' );

//set the text of the excerpt Keep Reading Link
function new_excerpt_more( $more ) {
	return '... <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More &rarr;', 'enlightenment') . '</a>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );

These functions let me customize the excerpt length and make the Keep Reading link customized for my needs.

Thanks for such a flexible theme!