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 wish I knew PHP as well as I do Rails. I'd imagine this is fairly intuitive.

Thanks!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Wordpress has an inbuilt function called the_excerpt() which echoes an excerpt of the post content.

By default an excerpt is 55 characters. You can set it to 200 like so:

function your_excerpt_length( $length ) {
    return 200;
}
add_filter( 'excerpt_length', 'your_excerpt_length' );

This should go into your theme's functions.php, ideally.

EDIT: To manipulate the excerpt more string, use the following:

function your_excerpt_more($more) {
    return '';
}
add_filter('excerpt_more', 'your_excerpt_more');

Given that you commented that the_excerpt() does not output the native [...], it is likely your theme already makes use of that filter somewhere else to replace the normal output with the described "… Continue reading →" link. So rather than adding it again, find that in your theme.

share|improve this answer
    
Anyway to get rid of the "read more" ? I already have a button for that. –  Trip Nov 15 '11 at 15:43
    
@Trip the_excerpt() should display [...] at the end, but not "read more". What is the exact string it outputs after the 200 characters? I will update my answer accordingly. –  Johannes Pille Nov 15 '11 at 15:49
    
It gives me a … Continue reading → But I don't need those because I already made a button. –  Trip Nov 15 '11 at 15:52
    
Ah I didn't realize the themes had their own custom functions as well. Thanks so much Johannes! –  Trip Nov 15 '11 at 15:58

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.