How to bypass original image size
-
Hi,
My client’s posts are rendering the original size image by default. Unfortunately, these images are often huge. Is there a way prevent this from happening?
In the RWP settings, I’m specifying two custom images sizes. And below is the code I have in functions.php.
// add custom images sizes add_image_size( 'singlepost-small', 480, 9999 ); add_image_size( 'singlepost-medium', 600, 9999 ); // set images sizes and media queries $posts = get_posts( array( 'post-type' => 'post', 'rwp_settings' => array( 'sizes' => array('singlepost-small', 'singlepost-medium'), 'media_queries' => array( 'singlepost-small' => 'min-width: 320px', 'singlepost-medium' => 'min-width: 481px' ) ) ) );
Here’s an example page with two images: https://www.kamaeinhorn.com/liminal/. (As a temporary workaround, I re-sized the original images by hand.)
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to bypass original image size’ is closed to new replies.