-1

How can I set a image size bigger then the defined max content width in the media box?

The content width is set to:

if ( ! isset( $content_width ) ) {
    $content_width = 960;
}

If I add now a picture with size bigger then the $content_with, it get scaled down.

add_image_size( 'post-visual', 2048, 900, true );

The picture gets sized but at the moment it appears in the media box only with the dimensions of 960x421.

  • I guess that image scales down by css rules. Check css for that image. There must be max-width: 960px; – Alexey Sep 6 '15 at 12:19
1
  1. Did you use wp_get_attachment_image_src('$post_id','post-visual'); for getting your desire image sized? If not then try to use this function for getting proper image size.

  2. Check CSS for that image width or max-width and it has to be width: 100%; css property.

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.