All the sources mention this as if it worked.

Medium size is set to 635x194, but I still get this out:

<img width="100" height="100" title="fjaril" alt="fjaril" class="attachment-thumbnail" src="http://blogg.nassjo.se/klassblogg/files/2012/12/fjaril-100x100.jpg">

As you see, it hard-links to the shrunken thumbnail size. Docs say I should get a class matching the size argument in the img HTML also.

Where should I look, and what to fix?

I'm just trying to get the first post on the front page to display its featured image medium-sized. I'm modifying content.php in the theme. I can search-and-replace, but that would break if the customer changes thumbnail sizes.

The website is here: http://blogg.nassjo.se/


Just made a child theme, and there, it works as it should.

See http://blogg.nassjo.se/klassblogg/

Update 2 I made a child theme for the main site also, but that did (unexpectedly) not make it work. I have to conclude that the_post_thumbnail('medium') only works on the site where it was posted.

I've put the img html in a var and search/replaced to get the medium size and url, and that hack works.

I'll leave the question up for a bit, in case someone can help me find the real reason so I can remove the hack.

  • What are the dimensions of the full-size image? – Chip Bennett Dec 18 '12 at 17:08
  • In this case,635x194. – Henrik Erlandsson Dec 19 '12 at 7:33

Install Regenerate Thumbnails. Run it once, and see if your images are being generated.

Feel free to keep the plugin installed for future use. (it won't break anything if you do uninstall it after you're done)

  • I like Force Regenerate Thumbnails, an extension of the original. Gets rid of unneeded sizes as well. – GhostToast Dec 18 '12 at 17:38
  • The images are there and in the correct size. I can say that because {the_post_thumbnail('medium');} works in the child theme (see update). – Henrik Erlandsson Dec 19 '12 at 7:32

Does medium size exist? you can check by vardumping the global:
global $_wp_additional_image_sizes;

An other possibility is that the filter post_thumbnail_html is screwing something up.

Also can you add the code that returns this <img /> tag?

  • The code is in the question title :) var_dump gives an array with 4 sizes, including 'medium'. – Henrik Erlandsson Dec 18 '12 at 15:26
  • try disabeling plugins to see is one of them brakes it. – janw Dec 18 '12 at 15:35
  • Edited the question with important information. I'm currently only using Sitewide Tags and WPMU Site Categories, but I will test. – Henrik Erlandsson Dec 18 '12 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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