Global $post shows null in some of my custom post types archive pages
The global $post object represents the current post within The Loop and is created by the the_post() function. It enables functions like the_title(), the_content() etc. to show the title and content for the current post without needing to pass IDs or anything. This is why a post type archive doesn’t have a $post object set … Read more