Snippets: Automatically Display Featured Image At The Top Of Pages

function my_page_featured_image() {
	if ( is_page() && has_post_thumbnail() ) {
		echo '<div class="my-page-featured-image clr">'. get_the_post_thumbnail() .'</div>';
	}
}
add_action( 'wpex_hook_main_top', 'my_page_featured_image', 10 );

Snippet Type: PHP

Posted Under: Pages

All PHP snippets should be added via a child theme's functions.php file.