Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using this directly from the codex to list 3 recent articles titles.

<ul>
<?php
$args = array( 'numberposts' => '3');
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' .   $recent["post_title"].'</a> </li> ';
}
?>
</ul>

This works fine however, when I change the post_title to post_excerpt it does not show the excerpt.

How can I solve this?

share|improve this question

1 Answer 1

Steal the code from get_the_excerpt():

apply_filters( 'get_the_excerpt', $recent['post_excerpt'] )
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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