Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In case there's more than one function the exact one is:

php the_excerpt();

I want to decrease the character length to X amount and I want to remove the [...] and replace it with an image that users can click to take them to the article. How do I accomplish this (preferably without plugins)?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You need to hook into two WordPress filters.

function custom_excerpt_length( $length ) {
    return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_length

function custom_excerpt_more( $more ) {
    return '[.....]';
}
add_filter( 'excerpt_more', 'custom_excerpt_more' );

http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_more

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.