Solution:
Try This Code Work For Me global $post dosent work in init
function check_the_current_page() { global $post; echo "Post id: " . $post->ID; } add_action( "wp", "check_the_current_page" );