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.

Is there a way of hiding a blog posts text if it's longer than let's say 300 characters.

I don't want it to push the rest of the content below the fold.

You know, the show more text thing.

share|improve this question
add comment

1 Answer

You could use this filter which can be found in the default WordPress themes functions.php file (twentyten). This will limit the post to 300 characters, so theres no need to hide it.

function twentyten_excerpt_length( $length ) {
    return 300;
}
add_filter( 'excerpt_length', 'twentyten_excerpt_length' );

There are other means to achieve the same thing, but stick to whats already available and you should be fine.

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.