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

How do I get the height and width of default image sizes? I am not talking about custom image sizes, which can be retrieved from get_intermediate_image_sizes(). I want to get size attribute for 'thumbnail', 'medium', and 'large'.

Update Base on answer by Mridul Aggarwal, looks like i can do:

function get_image_size ($size) {
      return (array(get_option($size. '_size_w'),get_option($size. '_size_h')); 

Is this the only way?

share|improve this question

If you want to get those set in the admin panel, use the function get_option. The keys are


If you want them for some specific attachment, use wp_get_attachment_image_src

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.