Używa się do tego parametru offset=1
.
Jednak użycie go w zapytaniu psuje paginację i trzeba podpiąć się pod akcje pre_get_posts
:
add_action('pre_get_posts', 'myprefix_query_offset', 1 );
function myprefix_query_offset(&$query) {
//Before anything else, make sure this is the right query...
if ( ! $query->is_home() ) {
return;
}
//First, define your desired offset...
$offset = 1;
//Next, determine how many posts per page you want (we'll use WordPress's settings)
$ppp = get_option('posts_per_page');
//Next, detect and handle pagination...
if ( $query->is_paged ) {
//Manually determine page query offset (offset + current page (minus one) x posts per page)
$page_offset = $offset + ( ($query->query_vars['paged']-1) * $ppp );
//Apply adjust page offset
$query->set('offset', $page_offset );
}
else {
//This is the first page. Just use the offset...
$query->set('offset',$offset);
}
}
Dokumentacja: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
Jeżeli nie będzie działaś, lub na koniec paginacji dostaniesz 404, będziesz musiał usunąć query_posts()
Można pokusić się też na takie rozwiązanie i do WP_Query dodać cos takiego:
$latest = get_posts("post_type=post&numberposts=1");
$exclude = $latest[0]->ID;
$args = array(
'post__not_in' => array ( $exclude ),
);
query_posts( $args );
Jednak to też psuje paginację.