Set add_image_size() greater than content width in media box

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.

Topic content-width images Wordpress

Category Web


  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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.