In the plugin settings there is an option to specify custom media queries and you can set the full sized image to display at a given breakpoint. Is it possible to do this with custom code for manual insertion?
I would have thought I add “full” with my image size names, but i’m not sure what i put for the “sizes” attributes as normally you specify the image size for the breakpoint but different images will have different full sized dimensions.
Not sure if i’ve explain that well, but here’s what i want to do in the code:
$thumbnail_id = get_post_thumbnail_id( $post->ID );
echo rwp_img( $thumbnail_id, array(
‘sizes’ => array(‘FULLSIZE IMAGE‘, ‘featured-desktop’, ‘featured-tablet-p’, ‘featured-phone-l’, ‘featured-phone-p’ ),
‘attributes’ => array(
‘sizes’ => ‘(min-width: 1024px) THEN SHOW FULLSIZE IMG, (min-width: 768px) 1036px, (min-width: 568px) 900px, 507px’,
‘alt’ => get_post_meta( $thumbnail_id, ‘_wp_attachment_image_alt’, true)
- The topic ‘Full Size Image Custom Code’ is closed to new replies.