Hello @johnnyfraisse,
You can use the offset parameter in the wp_query function to exclude the latest posts from the WordPress post loop. You can collect all posts IDs in an array in the first loop, and excluded those posts from the second loop using post__not_in
which expects an array of post IDs.
?
You can use the following filter in your child theme’s functions.php file:
function filter_post_query( $query_args, $attributes) {
// Modify $query_args values.
// 123 is the post id you want to exclude.
$query_args['post__not_in'] = array( 123,456 );
return $query_args;
}
add_filter( 'uagb_post_query_args_grid', 'filter_post_query', 10, 2 );
In the above code, the array (123, 456), the 123 and 456 in the post ID which you want to exclude.
?
I hope this helps. Let me know if you have further queries.
Regards,
Sweta