I’m struggling with the query for this in WordPress to display posts in a category from the 6th most recent onwards.
Basically, I have a top 5 posts section at the top of a category for featured posts (marked as posts in that specific category AND in a Featured category), then in the page content I don’t want any of those top 5 featured posts shown in the regular posts loop.
Any help would be greatly appreciated.
$query = new WP_Query( array( 'category__and' => array( 2, 6 ), 'offset' => 5 ) );
Without seeing your code, here’s a rundown that should work for you.
$featured_posts = array();
$featured_posts[] = get_the_ID();
if ( in_array( get_the_ID(), $featured_posts ) ) continue;