WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom field called picture. On the media settings page I've set thumbnail size to 100x100. If upload an image called gecko.jpg, WordPress automatically resizes it and generates gecko-100x100.jpg. I want to use both the thumbnail size and original size, is it possible?

With <?php echo get_post_meta($post->ID, 'picture', true); ?> I can only get the original size.

share|improve this question
up vote 2 down vote accepted

can you explain why do you need custom fields ? (personally i think they are HUGELY over-used.. especially for images )

if there is no specific reason why you need it , you could use the the_post_thumbnail(); function .

like so :

the_post_thumbnail('thumbnail');       // Thumbnail (default 150px x 150px max)
the_post_thumbnail('medium');          // Medium resolution (default 300px x 300px max)
the_post_thumbnail('large');           // Large resolution (default 640px x 640px max)

all you have to do , is when you upload your image - define it as "featured image"

(first check if your functions.php file has this line: add_theme_support('post-thumbnails'); and if not - then add it .

if you want to go further and add some more custom sizes , you can add also this :

set_post_thumbnail_size( 150, 230, true ); // Normal default post thumbnails
add_image_size( 'single-post-thumbnail', 400, 9999 ); // Permalink thumbnail size
add_image_size( 'example_name_2', 100, 100, false ); // example_name_2 thumbnail size
add_image_size( 'example_name_3', 50, 50, true ); // example_name_3  thumbnail size

etc.. et.. you can add as many as you like, and then call them like :


(newbie note - all the above code should be placed in functions.php file. the function call the_post_thumbnail(); is to be places inside the loop.)

share|improve this answer

Your Answer


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.