Accessing $post global on a custom post type archive page

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)