How To Add Featured Image Support To A WordPress Theme
If you look beside this post, you will see an icon or image of the WordPress badge. This was added to the post so it displays as a ‘Featured Image’ or Post Thumbnail and it can be set so it clicks through to the blog post.
Adding Featured Image support to a WordPress Theme is a pretty simple process and aside from the styling, requires only a bit of cut and paste.
You are going to edit 3 files:
2. index.php (or loop.php)
Open up your functions.php file and paste this in:
// add featured image support
add_theme_support( 'post-thumbnails' );
You need to make sure it is between <?php and ?> for it to add support for featured images, or post-thumbnails as they are called.
Save the file and open up your index.php (or loop.php for child themes) file. Add this code, wherever you want it to appear in the loop:
<!-- display featured images -->
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
Save the file and style it by opening your style.css and adding something like this:
/* ==== featured image ==== */
Once you save this file, log in to your WordPress admin panel and you will see a new palette on the sidebar.
From here you can select your image and pick the use as featured image option.other page