Skip to content

Instantly share code, notes, and snippets.

@lucasstark
Created May 16, 2013 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasstark/5593386 to your computer and use it in GitHub Desktop.
Save lucasstark/5593386 to your computer and use it in GitHub Desktop.
global $post;
if (basename( get_page_template() ) != 'some-template.php') {
$featured_image_post = get_featured_recursive($post);
if ($featured_image_post != null) {
$featured_image_src = wp_get_attachment_image_src(get_post_thumbnail_id($featured_image_post), 'single-post-thumbnail'); ?>
<img src="<?php echo $featured_image_src[0]; ?>" alt="<?php the_title(); ?>" />
<?php }
else {
if (has_post_thumbnail()){
//output the thumbnail normally
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment