Created
August 6, 2017 04:07
-
-
Save KalobTaulien/c61f632ccfab64440bcbfd94e52d515a to your computer and use it in GitHub Desktop.
Adds different thumbnail sizes and setups up default jpeg quality to be 100%
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 | |
function application_setup() { | |
// Thumbnail sizes. Change as needed. | |
// NOTE: These only take affect on new uploaded images. | |
add_image_size('icon', 50, 50, true); | |
add_image_size('small', 150, 150, true); // small, 150px width, 150px height, crop: true | |
add_image_size('medium', 250, 250, true); | |
add_image_size('large', 500, 500, true); | |
add_image_size('xlarge', 1000, 1000, true); | |
add_image_size('banner', 1400, 200, true); | |
// Do NOT compress jpegs. We want beautiful images. | |
add_filter('jpeg_quality', create_function( '', 'return 100;' ) ); | |
} | |
// Sets up your theme-based functions | |
add_action('after_setup_theme', 'application_setup'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment