problem with Media (Image) size

I have one problem with media size using Travelify theme. I set new Media image size in Settings–>Media:
Thumbnail size: width 230px height: 230px
Medium size: width 620px height: 620px
Large size: width 1000px height: 1000px

But now during post editing when I try to add big image (e.g. 2032x1361px) there is some strange issue. Image is added to Media Library without any problem, but if I want to add this image to post there is problem. I have sizes to use:
Thumbnail - 230px
medium - 620x415px
large - 700x469px
Full size - 2032x1361px

So the problem is with “large” one - it should be 1000px not 700px. Moreover image size 1000px IS generated by wordpress (I can see it in /uploads/ folder.

Additionaly when I choose “large” and I add image to post it will generate this code:

<a href=""><img src="" alt="azory-przyroda-zdjecia-2000px" width="700" height="469" class="aligncenter size-large wp-image-78" /></a>

So you can easily see that 1000px image is generated and 1000px is used but in html code wordpress puts width=“700” height=“469” instead of width=“1000” height=“670”

Do you know how to fix it?*

  • I found one way to fix it. I need to change


if ( ! isset( $content_width ) )
	$content_width = 700;

from function.php to

if ( ! isset( $content_width ) )
	$content_width = 1000;

But I dont know if changing it will not cause problems with something else?

There is no point to insert wider images than post content area and that’s why there is such thing as $content_width.

If you are creating custom page template that does require wider images then then you can use function such as we have for our other theme. It sets different content width for different page templates.

If you change content width it will affect plugins such as Jetpack with its tiled galleries and some other plugins that depends on this but there are loads of themes that doesn’t even have content width defined and that’s fine too because it is not crucial.

I just need to use it (propobably) on some post with photos - I will disable sidebar for them (one column layout), so in this case wider images are needed.