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'm trying to add a new image size of 300x300..

This works, but if the uploaded file is for example 300x300, it doesn't upload the resized image.. You'd say that isn't a problem because the original is the resolution I need, but I get the image later on with:

wp_get_attachment_image_src( $meta['background'][0], array(300,300) );

And if this image is not there, wordpress fetches another size, which of course is not what I want..

What should I do?

share|improve this question

I have added an image size

<?php add_image_size( 'test', 300, 300, true ); ?>

Uploaded an image of exactly 300 x 300px,

Then got the image

<?php wp_get_attachment_image_src( $id, array(300,300) );?>
<?php wp_get_attachment_image_src( $id, 'test' );?>

Works both ways. Maybe you did not define the image size correctly in functions.php

share|improve this answer
I also added the size to show itself in the uploader, when I upload an image, all sizes bigger or the same as the uploaded image size are disabled.. I'll try switching of showing them, but I doubt it will help.. Thanks for your help! – Tim Baas Dec 15 '12 at 13:37
You should not worry about that. Just upload the image and test if you can get it to show. – K Themes Dec 16 '12 at 9:35

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.