Skip to content

Instantly share code, notes, and snippets.

@KalobTaulien
Created August 6, 2017 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KalobTaulien/c61f632ccfab64440bcbfd94e52d515a to your computer and use it in GitHub Desktop.
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%
<?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