You haven’t exposed the global $post
variable after calling $the_query->the_post()
.
Either add global $post
right after calling $the_query->the_post()
, or replace $post->ID
with get_the_ID()
.
You haven’t exposed the global $post
variable after calling $the_query->the_post()
.
Either add global $post
right after calling $the_query->the_post()
, or replace $post->ID
with get_the_ID()
.