How to get current page ID outside the loop?
global $post; echo $post->ID;
or (I don't know the difference)
global $wp_query; echo $wp_query->post->ID;
You can simply do,
$page_id = get_queried_object_id();
you can do it by adding below code.it will give you current page id.
$postid = get_the_ID(); echo $postid;