Sunday, November 10, 2013

Upload Multiple Featured Post Thumbnails in Wordpress

Hiiiiiii, sometimes it happens that if you are are developing a wordpress website and on some of your pages or post you want to show more than one featured images then if you choose a normal image showing procedure in html with 'img' tags then it is a very big and lengthy procedure and for that you have to make changes in many files and have to perform many steps like- firstly upload an image with wordpress upload, then you have to give the full path of that image to "img" tag.
But here in this post I'll be telling you a very easy way to add many featured images in wordpress posts, pages or templates. In the method I'll be teaching here, there is a full provision of adding unlimited featured images for particular posts and pages.

wordpress-multiple-post-thumbnails


Steps to add multiple Featured images : 

1. Firstly install a Multiple Post Thumbnails plugin in you wordpress.
2. Then register the images in your functions.php by using code as shown below :

if (class_exists('MultiPostThumbnails')) {
new MultiPostThumbnails(
'label' => 'Seco
array(
ndary Image', // label of image which you want to see in admin panel for image upload
'id' => 'secondary-image', // id of image
}
'post_type' => 'post' ) );
3. Upload an image in admin panel for particular posts and pages.

4. Use and display this registered image in templates, posts and pages by using the codes as shown below :
<?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image'); endif; ?>
Register as many images you want to use in functions.php with different "id" and "label" and then use that images.
To know more about this plugin, click here

Hope you like this post……..Please Comment…………!!!!!!!!!


Tags:

0 Responses to “Upload Multiple Featured Post Thumbnails in Wordpress”

Post a Comment

© 2013 MyCodeStock. All rights reserved.
Designed by SpicyTricks