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.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
great! thank you :) –  zac Aug 7 '11 at 5:07

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.