Last Updated: February 25, 2016
·
675
· rajeshkhatri13

Featured image as header image or post image

add below in function file


addthemesupport( 'post-thumbnails' );
setpostthumbnail_size( 624, 9999 ); // will set image width 624px and Unlimited height, soft crop
</code></pre>

add below in your template file


<?php
if ( haspostthumbnail() ) {
    // the current post has a thumbnail
    thepostthumbnail();
} else {?>
       <img src="<?php echo gettemplatedirectory_uri(); ?>/images/place-hoder-img.jpg" class="">
<?php
}
?>
</code></pre>