Posted By

chrisaiv on 09/13/14


Tagged

wordpress


Versions (?)

Wordpress: Limit The Excerpt’s Word Count


 / Published in: PHP
 

URL: http://www.smashingmagazine.com/2011/12/07/10-tips-optimize-wordpress-theme/

One thing that can go wrong in WordPress magazine themes is when users include too many words before the more tag.

  1. /**
  2. * Limit The Excerpt’s Word Count
  3. *
  4. * http://www.smashingmagazine.com/2011/12/07/10-tips-optimize-wordpress-theme/
  5. *
  6. *
  7. */
  8. function ilc_excerpt_length( $length ){
  9. return 10;
  10. }
  11. add_filter('excerpt_length', 'ilc_excerpt_length');

Report this snippet  

You need to login to post a comment.