Put in the following line at the top of archive page :
global $post;
Thing is you need to access the global $post object before trying to use it.
Put in the following line at the top of archive page :
global $post;
Thing is you need to access the global $post object before trying to use it.