Couple of issues here
-
IIRC,
exclude
should be an array of ID’s asexclude
get passed toWP_Query
aspost_not_in
-
You are defining arguments which you don’t use. You could have simply passed that to
get_posts
. Rememeber, all parameters inWP_Query
is available as is toget_posts
asget_posts
usesWP_Query
-
You can simply use
'offset' => 1,
to skip the most recent post. You are running total unnecesarry queries here which slows your page down
You can try the following
$args = [
'posts_per_page' => 5,
'offset' => 1
];
$recent_posts = get_posts( $args );