2 Fixed formatting
source | link

Take a look into the function single_post_title() in the general-template.php file and you will find following: $_post = get_queried_object();

$_post = get_queried_object();

and in that function you also see: $_post->post_title

$_post->post_title

which gives you the title of the page outside of the loop.

Now to get the Featured Image you simply do the following

$_post = get_queried_object();
echo get_the_post_thumbnail($_post->ID);

$_post = get_queried_object(); <br>echo get_the_post_thumbnail($_post->ID);

Take a look into the function single_post_title() in the general-template.php file and you will find following: $_post = get_queried_object();

and in that function you also see: $_post->post_title

which gives you the title of the page outside of the loop.

Now to get the Featured Image you simply do the following

$_post = get_queried_object();
echo get_the_post_thumbnail($_post->ID);

Take a look into the function single_post_title() in the general-template.php file and you will find following:

$_post = get_queried_object();

and in that function you also see:

$_post->post_title

which gives you the title of the page outside of the loop.

Now to get the Featured Image you simply do the following

$_post = get_queried_object(); <br>echo get_the_post_thumbnail($_post->ID);
1
source | link

Take a look into the function single_post_title() in the general-template.php file and you will find following: $_post = get_queried_object();

and in that function you also see: $_post->post_title

which gives you the title of the page outside of the loop.

Now to get the Featured Image you simply do the following

$_post = get_queried_object();
echo get_the_post_thumbnail($_post->ID);