You’re doing it outside of The Loop there, so $post is undefined at that point. Put it above the endwhile
and it should work.
You’re doing it outside of The Loop there, so $post is undefined at that point. Put it above the endwhile
and it should work.