Is there an argument to define how many posts ago will be displayed in "recent" posts. Could I add something to this and define a specific number of posts ago to start the loop?

$args = array( 'numberposts' => '5' );
$recent_posts = wp_get_recent_posts( $args );

So for example I have a page of archives with their excerpts for the last 5 posts. In the sidebar I would like to show other posts from that category, starting with 6 posts ago.


wp_get_recent_posts basically uses WP_Query, so you can use the offset parameter.

So something like,

$args = array( 'numberposts' => '5', 'offset' => 5 ); 

Reference: http://codex.wordpress.org/Class_Reference/WP_Query#Offset_Parameter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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