Created
May 14, 2015 02:05
-
-
Save daltonrooney/74b1a13c6c2b22eed7d6 to your computer and use it in GitHub Desktop.
Add image sizes on the front end only
This file contains 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
add_action( 'after_setup_theme', 'front_end_image_sizes' ); | |
function front_end_image_sizes() { | |
//Only register these on the front end for our templates | |
if ( !is_admin() && ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) ) : | |
add_image_size( 'hero', 2000, 1000, false ); | |
add_image_size( 'smallish', 400, 400, false ); | |
add_image_size( 'tweener', 900, 700, false ); | |
endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment