Skip to content

Instantly share code, notes, and snippets.

@daltonrooney
Created May 14, 2015 02:05
Show Gist options
  • Save daltonrooney/74b1a13c6c2b22eed7d6 to your computer and use it in GitHub Desktop.
Save daltonrooney/74b1a13c6c2b22eed7d6 to your computer and use it in GitHub Desktop.
Add image sizes on the front end only
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