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.

I am displaying the wordpress posts on the index page with:

<?php the_excerpt(); ?>

In my functions.php file I have following code:

add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($length) {
return 30; }

This works fine but it shows [...] at the end of excerpt. I want to remove these [ and ] and instead I want to show only three dots ... . How can i do that? Thanks.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Use the excerpt_more filter hook:

function mytheme_excerpt_more( $text ) {
    $text = '...';
    return $text;
}
add_filter( 'excerpt_more', 'mytheme_excerpt_more' );
share|improve this answer
add comment

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.