I'm trying to exclude the latest two blog posts from a page.
I know it's possible to do this with
offset however doing that causes a bug in which some of the blog posts are repeated on the second page so not ideal.
Currently I'm doing it manually using the post id so like this:
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : '1'; $args = array( 'posts_per_page' => 5, 'post__not_in' => array(827, 809), 'post_status' =>"publish", 'post_type' =>"post", 'orderby' =>"post_date", 'cat' =>'-1, -8, -9, -7, -6, -5, -4', 'paged' => $paged ); $postslist = get_posts( $args ); echo '<div class="latest_new_posts main-news">';
Can anybody think of a better way of doing this where I don't have to adjust the post id constantly?