W3 Mind Logo
Home » Featured image WordPress

Featured image WordPress

Just add the following code in your template file. Where you want to show the featured image.


<?php //Featured Image Code
if(has_post_thumbnail())
    {
$thumbnail=wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),"full");
    ?>
<img src="<?php echo $thumbnail[0];?>" alt="<?php the_title();?>"/>
<?php }
    ?>

About Author
W3Mind

W3Mind

W3Mind focuses on Blogging, Make Money Online, SEO, Business Blogging, Social Media, WordPress, Internet Tools, Web Design and Development.
Give it a Share
Facebook
Twitter
LinkedIn
You May Also Like
Leave a Reply

Your email address will not be published. Required fields are marked *

How to
START A
BLOG
(step by step)
Load WordPress Sites in as fast as 37ms!