How to Show First Image In Post as Thumbnail In WordPress Blog

I’ve shared a plugin called Thumbnail For Excerps that let you show thumbnails in your blog’s homepage using wordpress blogging platform.Here’s Attached Image WP plugin that will automatically show the first image in your post as a thumbnail image in your blogs homepage with more control on how the images look and easier to manage.

  • It can show the full, medium or thumbnail sized image attached to the current post.
  • It can make a hyperlink around the image that points to the post the image is attached to, the full image, the attachment page or a custom URL using custom fields on a post by post basis.
  • If more than one image is attached to a post then the image to be shown can be changed using the WordPress gallery page. Just pull the image you wish to show right to the top of the list and press save.

The plugins options page makes it easy to customize how the plugin works.Just call the plugin function within the loop.

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
      	<!-- Some HTML will be here –>
<?php the_attached_image(); ?> /*Insert this code preferably after the the_title() function*/
<?php endwhile; ?>
<?php endif; ?>

You can also pass parameters,like this

<?php the_attached_image('img_size=thumb&css_class=hpimg'); ?>

You can set more options right from the Plugins Options Page, that will be available after activating the plugin.


The added advantage with this plugins is that in case you have been using Custom Fields With your current theme, you can also call the images set using custom fields using the plugin.

Similar Post  Create Custom Media Player For Your Blog

You can also choose to show the nth as the thumbnail using the Pick Functionality from the options theme, you can enable this by checking the Pick Functionality box and providing a number (n), the plugin will instead use the nth numbered image tag from the post content as the thumbnail.

You can also have multiple instances of the function call by passing parameters.You can also pass the parameters of the options available through the plugins options page, Check out the list of supported parameters here.

Download The Attached Image Plugin | Plugin Documentation

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.