show an excerpt for recent posts of a specific category
-
i am trying to write the code for having just an excerpt of posts from a specific category (news) show on a page.
here is the code i have:
<h6>Latest News</h6> <p><?php $args = array( 'numberposts' => '2', 'category' => 6, ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent ){ echo '<a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a>'; echo '<br> Lorem ipsum dolor sit amet nuno valencia esta di mari askebar de coloumbusus.'; echo '<a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" > <hr>read more <br></a>'; } ?> </p>
i can’t figure out how to call the excerpts.
for now i just put “
Lorem ipsum dolor sit amet nuno valencia esta di mari askebar de coloumbusus.” where i want the excerpt.i’ve searched but i can’t find anything relevant to within an argument array.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘show an excerpt for recent posts of a specific category’ is closed to new replies.