2

Is it possible to control the length of the content or excerpt for a specific query/loop?

I have come across the following code, but this changes the length for all excerpts, I want it focused on a specific custom query.

    add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($length) {
return 20; }

2 Answers 2

1

Try this: http://pippinspages.com/tutorials/better-wordpress-post-excerpt-revamped/

3
  • Ah, there it is. Your article was the one I was actually looking for.... I remembered reading it, but forgot who wrote it. Mar 10, 2011 at 20:13
  • Excellent, glad it was helpful.
    – Pippin
    Mar 10, 2011 at 20:33
  • The link is broken :(
    – TheBird956
    Jan 30, 2018 at 14:47
0

http://wpengineer.com/1909/manage-multiple-excerpt-lengths/ Does this work for you?

Can apply different excerpts to each time you actually call the_excerpt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.