Support » Themes and Templates » Thumbnails..

  • When i upload and image to the media manager are all the image sizes set in the media tab under setting created as well?

    at the moment i have an image in a post and i need that same image to be a thumbnail. I am using css and html to resize the image however if the image is huge the resize is okay but effectively the user will have to download the full image.

    I want to load a thumbnail instead.

    What is the best way to achieve this?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Yes WordPress automatically generates all image sizes from the image you upload, that includes the full size, large, medium, and thumbnail.

    You can select the size of the image you want to insert into the post using the media uploader.


    The thumbnails are the names of the original image with the image size appended to the end, typically thumbnails are 125x125px.

    Hence if you upload an image called hello.jpg and find the URL for that file, typically:


    The thumbnail will therefore be:


    how do i access this through code?

    You could do something like this inside the loop:

      $size = 'thumbnail'; //thumbnail, medium, large or full
      echo get_the_post_thumbnail(get_the_ID(), $size, '');

    Or if you want to create a custom size you can do something like this:

    if ( function_exists( 'add_image_size' ) ) {
      add_image_size( 'homepage-thumb', 220, 130, true );
    echo get_the_post_thumbnail(get_the_ID(), 'homepage-thumb', $attr);

    More info here

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Thumbnails..’ is closed to new replies.