Page/Post ID in header footer

global $wp_query;
$post_id = $wp_query->post->ID;
if ($post_id==”)

Leave a Reply

Your email address will not be published.