It seems that at that point, $post
is not yet defined, you can make sure by turning debugging on.
Then add this before your get_post_meta( $post...
:
global $post;
Or you can replace $post->ID
with get_the_ID()
.
It seems that at that point, $post
is not yet defined, you can make sure by turning debugging on.
Then add this before your get_post_meta( $post...
:
global $post;
Or you can replace $post->ID
with get_the_ID()
.