/*-----------------------------------------------------------------------------------*/
/* Sets the post excerpt length to 40 characters.
/*-----------------------------------------------------------------------------------*/
function bugis_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'bugis_excerpt_length' );
/*-----------------------------------------------------------------------------------*/
/* Returns a "Continue Reading" link for excerpts
/*-----------------------------------------------------------------------------------*/
function bugis_continue_reading_link() {
return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'bugis' ) . '</a>';
}
/*-----------------------------------------------------------------------------------*/
/* Replaces "[...]" with an ellipsis and bugis_continue_reading_link() in excerpts.
/*-----------------------------------------------------------------------------------*/
function bugis_auto_excerpt_more( $more ) {
return ' …' . bugis_continue_reading_link();
}
add_filter( 'excerpt_more', 'bugis_auto_excerpt_more' );
/*-----------------------------------------------------------------------------------*/
/* Adds a pretty "Continue Reading" link to custom post excerpts.
/*-----------------------------------------------------------------------------------*/
function bugis_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= bugis_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'bugis_custom_excerpt_more' );