Page Parent Post Thumbnail

Use this to grab the Featured Image from the post parent if the child page is not using a Feature Image.

global $post;

if (the_post_thumbnail() != '') {
	the_post_thumbnail();
} else {
	echo get_the_post_thumbnail($post->post_parent);
}

Similar method found here.

Leave a Reply

Posted in php
katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.