Custom Excerpt Snippet
You can use this code in your functions.php file to change the excerpt length and also the ‘more’ tag.
// Replaces the excerpt “more” text by a link
function new_excerpt_more($more) {
global $post;
if (is_category( ’21’ )){
return ‘ View Image Gallery‘;
} else {
return ‘ Read the full article…‘;
}
}
add_filter(‘excerpt_more’, ‘new_excerpt_more’);
//custom excerpt length
function custom_excerpt_length( $length ) {
return 25;
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );