4. What is Responsive Design
• Design and development respond to the user
• Layout tailored for resolution, image size,
scripting
• Media Queries to determine layout at
different sizes
• Percentages rather that fixed width
• display: none - to hide sections when
appropriate
9. Why Responsive Images?
Mobile users have surpassed desktop users
Images comprise up to 62% the web
No benefit of hi-res images on low-res screens
Small images look fuzzy at high resolution
15. Retina Images
• Term Created by Apple for the iPhone 4
• High pixel density
• Pixels are not visible to the eye
• resolution effectively half
• 2560x1600 is 1280x800
• HiDPI displays
• 2x, 3x resolution
16. High Res images
• Retina Images
• high resolution
• double, triple or even
higher
• aspect ratio maintained
1x
2x
3x
18. New in WordPress 4.4
Support for srcset HTML attribute
Uses default sizes attribute
Reference:
https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/
19. New Image Size as of 4.4
• Medium Large
• Dimensions - 768 x height
20. WordPress Default Image Sizes
• First Level
• Second Level
• Third
Level
• First Level
• Second Level
• Third
Level
22. Show all Image Sizes
Display all image sizes
• Use the example function from the codex
• Copy function and call it via var_dump:
var_dump( get_image_sizes() );
Reference:
https://codex.wordpress.org/Function_Reference/get_intermediate_image_sizes
24. Adding Images to the Media Library
Media -> Add New
•Uploads original file
•WordPress creates image
files for all media sizes
25. Custom Image Sizes
• Defaults sizes can be changed in the
dashboard
• Dashboard -> Settings -> Media
• Can be created via add_image_size()
• add_image_size($name, $width,
$height, $crop)
width x height
35. Which Image is Used
Browser Decides Based on a Calculation
•image width / display width
•results vary depending on browser
Reference:
https://css-tricks.com/responsive-images-youre-just-changing-resolutions-use-srcset/
36. WP Retina 2x
Media -> Retina
•Creates 2x version of each file
•Changes to 2x retina version
depending on resolution
Reference:
https://wordpress.org/plugins/wp-retina-2x/
40. Summary
• Responsive images allow for an optimized experience for all displays
• WordPress has built in support for responsive images
• Theme images outside of the Media Library will not be responsive