Change WordPress’s excerpt length
By: Zhiqiang Ma
On: Jan 26, 2010
Views: 37 No Comment
Print
Email
Tags: php, seo, tips, Web, wordpress
Tags: php, seo, tips, Web, wordpress
The default excerpt length of WordPress is 55 words. Some one like me may want to change the excerpt length.
I like the have a smaller excerpt length for the homepage. WordPress provides a interface for changing the default excerpt length. The method is very simple and easy.
Put these codes into the function.php file in the theme directory. I prefer 35 in my blog. It can be changed to any number you like. Or this value can be stored in the options table.
The code:
// excerpt length function option_excerpt_length($text){ return 35; } add_filter('excerpt_length', 'option_excerpt_length');
Read more:
- Use excerpt in index, category, tag and arhieve pages for WordPress
- Use noindex meta tag in WordPress to prevent search engine indexing categories, tags and archives
- RGBlite WordPress Theme
- Get the number of all posts in WordPress
- Friendly WordPress navigation using page numbers instead of next and previous links
- How to change the site’s default 404 Error not found page


















Leave your response!