Martin Harvey
Martin Harvey

Reputation: 233

WordPress Image Sizes and Responsive Design

OK, I get all the methods and thinking behind responsive design, I've created and mucked about with media queries and I know how to change image sizes based upon all of this with the css max-width: 100%; rule.

One thing that is bothering me that i cant seem to get my head around is this. When Im uploading images to WordPress for use inside my responsive theme, what sizes should they be? Do I need to define the images sizes as I would for a static site, or do I just upload the largest image size that I want to use and let the max-width take care of resizing everything for thumbnails etc.

Upvotes: 2

Views: 692

Answers (1)

The Alpha
The Alpha

Reputation: 146219

I'm not sure what you want but if you want to use for posts then you should not do it like you said instead you should use WordPress's add_image_size function and assign your image size like

if ( function_exists( 'add_image_size' ) ) {
    add_image_size( 'my-full-size',  9999, 9999, false );
    add_image_size( 'my-post-image',  140, 131, true );
    add_image_size( 'my-single-image',  140, 140, true );
}

And also you can assign your default thumbnail size from WordPress' media menu in admin panel. For more information about add_image_size function see http://codex.wordpress.org/Function_Reference/add_image_size

Upvotes: 0

Related Questions