<?php
/** -[ Cory Curtis - 2024-07-04 - For.Life Sites]-
* -( Remove Thumbs and Default Image Sizes )- *
// -[ ADD CUSTOM IMAGES ]-
// Make sure featured images are enabled
*/
add_theme_support( 'post-thumbnails' );
// Remove These Image Sizes
add_filter( 'intermediate_image_sizes_advanced', function( $sizes ) {
// Disable specific thumbnail sizes, uncomment the ones you want to disable.
// unset( $sizes['thumbnail'] ); // 150px x 150px
unset( $sizes['medium'] ); // 300px x 300px
// unset( $sizes['medium_large'] ); // 768px x 0px
unset( $sizes['large'] ); // 1024px x 1024px
unset( $sizes['1536x1536'] ); // 1536px x 1536px
unset( $sizes['2048x2048'] ); // 2048px x 2048px
return $sizes;
} );
// -( Add My featured image sizes )-
add_image_size( 'featured-medium', 640, 480, true ); // width, height, crop(true/false)
//add_image_size( 'featured-small', 320, 214, true );
add_image_size( 'hero-big', 1920, 0 ); // Hero BIG
add_image_size( 'slider-featured', 1200, 600, true ); // Large Content Slider
// -( Add other useful image sizes for use through Add Media modal )-
// add_image_size( 'lrg-width', 720, 0 );
add_image_size( 'thumb-full', 150, 0 ); // Set width to 150px, height is auto
add_image_size( 'small-square', 240, 240, true );
add_image_size( 'medium-square', 480, 480, true );
add_image_size( 'medium-width', 480, 0 );
// add_image_size( 'medium-height', 0, 480 );
// Register the image sizes for use in Add Media modal
add_filter( 'image_size_names_choose', 'truthemes_custom_sizes' );
function truthemes_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
'thumb-full' => __( 'Thumb 150xAuto' ),
'featured-medium' => __( 'Featured Med 640x480' ),
// 'featured-small' => __( 'Featured Small 320x214' ),
'hero-big' => __( 'Hero Big 1920px' ),
'slider-featured' => __( 'Slider 1200x600' ),
// 'lrg-width' => __( 'Large Width 720' ),
'medium-width' => __( 'Medium Width 480' ),
// 'medium-height' => __( 'Medium Height 480' ),
'medium-square' => __( 'Medium Square 480' ),
'small-square' => __( 'Small Square 240' ),
) );
}