Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For my site I use WordPress 3.6, and a wp-bootstrap theme that is built on bones framework.

When I set a featured image for a particular post, I see that the image is automatically saved at 6 different sizes:

Dashrath-Manjhi.jpg (Original Image)
Dashrath-Manjhi-620x400.jpg
Dashrath-Manjhi-300x197.jpg
Dashrath-Manjhi-250x300.jpg
Dashrath-Manjhi-150x150.jpg
Dashrath-Manjhi-125x125.jpg

Q#1: How to call a particular image using the_post_thumbnail()?

the_post_thumbnail('small'), the_post_thumbnail('medium'), the_post_thumbnail('large') always displaying the full size image.

I also gone through the theme documentation, I can't find how can I call.

Q#2: I would like to know whether this is WordPress based, or theme based?

Any ideas on how can I get the image of particular size using the_post_thumbnail() function would greatly be appreciated.

share|improve this question

2 Answers 2

Please refer to the WP-Admin » Settings » Media. There you will find all the image sizes a theme creates. Basically the WordPress by default creates three sizes unless the Original:

  • Large size (Default: 1024 x 1024)
  • Medium size (Default: 300 x 300)
  • Thumbnail size (Default: 150 x 150)

From the admin panel you can change their value too.

NOTE: Changing image dimensions can only work on new uploads after a successful save of the settings. Otherwise after a settings save you have to resize your images with a plugin like Regenerate Thumbnails by Viper007Bond.

A#2: Yes, the feature, unless the default three is basically Theme based.
A#1: You can call particular image sizes with <?php the_post_thumbnail('image-slug') ?>. And most the cases the image-slug, as I mentioned it, is the left-hand name of the size in the Media settings page.

NOTE: In general, code related to new image sizes are mentioned in the Theme's functions.php with a function named add_image_size().
Syntax: <?php add_image_size( $name, $width, $height, $crop ); ?>

Inspect and find accordingly if you fail with the Media settings' image size names. Good luck!

share|improve this answer
1  
I see only three sizes in WP-Admin -> Settings -> Media. Thumbnail 150*150, Medium Size 300*300, Large Size 1024*1024, But i am sure there are 5 different variants of uploaded image, The sizes are also not consistent (I guess it depends on the width of uploaded image). You can download wp-bootstrap theme here 320press.com/wpbs & test it for your self. Also I see 3 add_image_size on theme functions.php –  Jagan K Sep 25 '13 at 11:48

Your theme may have added support for additional images. In the functions.php file look for add_image_size( $name, $width, $height, $crop );.

You can add your own as well. Take a look at the codex for this function.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.