/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php //this part goes to functions.php function string_limit_words($string, $word_limit) { //add a ... at last article when more than limit word count //otherwise } //this part goes to template $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,25); ?>
URL: http://wordpress.org/support/topic/limit-the-number-of-words-in-excerpt-without-plugins