/ Published in: PHP
URL: http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/
This is a modified version of one from Aaron Russell. Super handy, allows you to pass the length as a parameter, and define the tags you wish to allow in the excerpt. It is tweaked to fit our needs. Tweaks include: - no need to "echo", just called customexcerpt (); - Can pass the length as a parameter customexcerpt (81);
Expand |
Embed | Plain Text
function custom_excerpt($length) { global $post; $text = get_the_content(''); $text = apply_filters('the_content', $text); $excerpt_length = $length; } }
You need to login to post a comment.
