Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Currently I have this written in my functions.php:

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

If I understand correct, this should re-size a relatively large image (1024x1024px) to an image with a maximum width of 560px.

My images however are getting re-sized (to a width of 800px), but not to the specified value of 560px.

Does someone know what I might be overlooking here, could someone explain to me the use of $content_width, and where the value of 800px currently is being specified?

For what it's worth all of my values listed at options-media.php are set as when installed.

Best regards,

Jen

share|improve this question

1 Answer 1

Place global $content_width; before your code.

share|improve this answer
    
Thanks both. I probably sound like a dumb :) but that is before if ( ! isset( $content_width ) ) $content_width = 560;? This as it seems to be doing nothing. At least it isn't obeying the 560px value. –  Jennifer Sep 17 '12 at 17:17
    
@Jennifer are you using a theme that you downloaded, or did you build it? You said the images are being resized to 800, which makes me think your theme is setting the image sizes elsewhere. Where are you getting/seeing 800 width? Also, are you sure your theme is not setting $content_width somewhere else? –  jessica Sep 17 '12 at 17:54

Your Answer

 
discard

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.