×

How to Add featured Image to multiple posts Instantly

featured-image-baby

How can you add featured Image to multiple posts instantly. Adding featured image to multiple post require a lots of work, you have to open, assign feature image and then update. This process you have to repeat with all the post that does not have any featured image.

How easy?  In fact this is a very laborious task, I tried for a few post and then gave up, start searching some sort of code for it or plugin.

So here comes my own version of this problem, One is through programmatically and another one is through Bulk-Select Featured Image WordPress plugin.

As a WordPress theme Developer, it is learn that featured images are coming through  the_post_thumbnail( ) function and whether that post contains a featured image or not can be checked through  has_post_thumbnail()

NOTE: before attempting this program, It is highly recommend that you must take backup of your index.php or single.php file or any other file where you want to show your post thumbnail

<?php if ( function_exists(“has_post_thumbnail”) && has_post_thumbnail() )
{
$title_attribute = the_title_attribute( array( ‘echo’ => FALSE ) );
$default_attr = array( ‘class’    => “alignleft”,
‘alt’   => $title_attribute,
‘title’ => $title_attribute
);
the_post_thumbnail(‘thumbnail’,$default_attr);
}
else { ?>
<img class=”alignleft” src =”<?php echo get_template_directory_uri(); ?>/images/default.jpg” width=”150″ height=”150″ alt=”pending image” />
<?php }  ?>

This code will automatically fill all the post thumbnail with a desired default image.  Alternatively, you can supply multiple default images of  depending upon the number of post.

Above code not only fill your blank post with a default image but also optimize your Images for SEO.

Bulk-Select Featured Image

Well, if you do not like the above method to implement or little bit scared with programming and all that then this WordPress plugin is very handy for you. It allow you to define your post featured image from media library dashboard directly.

This plugin add “Use as featured image”  link besides each post in media library. Simply choose the image and click on link. that’s it

Image Optimizer plugin

So this allows you to assign  featured image to multiple posts quickly, without visiting each post! I am sure you found this useful.

rakesh

The Whole concept was developed by the man you are watching here. I am rakesh Kumar Serial Niche Blogger and SEO Enthusiast. find me on Google+ , facebookandon twitter.. Developed popular WordPress theme for Wallpapers and funny Image WordPress theme. Love SEO optimized WordPress theme Designing and Customization.
Related Posts

Leave a Reply

Your email address will not be published.

+-