Created
March 30, 2018 18:47
-
-
Save morgyface/49042e41f42ff5e9a259f42a7d3b056a to your computer and use it in GitHub Desktop.
WordPress | Image sizes matching Bootstrap 4 breakpoint sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Custom image sizes using Bootstrap 4 breakpoints | |
| // Set here to crop at a 4:3 aspect ratio | |
| add_action( 'after_setup_theme', 'add_image_sizes' ); | |
| function add_image_sizes() { | |
| add_image_size( 'sm', 576, 432, true ); | |
| add_image_size( 'md', 768, 576, true ); | |
| add_image_size( 'lg', 992, 744, true ); | |
| add_image_size( 'xl', 1200, 900, true ); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment