Change WordPress’s excerpt length
By: Zhiqiang Ma
On: Jan 26, 2010
Views: 63 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!