Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

powerpack add custom image size

if ( function_exists( 'add_image_size' ) ) {
	add_image_size( 'video-gallery', 300, 169, true );
	add_image_size( 'full-panoramica', 1920, 650, true );
}

add_filter( 'image_size_names_choose', 'insert_custom_image_sizes' );
function insert_custom_image_sizes( $sizes ) {
	global $_wp_additional_image_sizes;
	if ( empty($_wp_additional_image_sizes) )
		return $sizes;

	foreach ( $_wp_additional_image_sizes as $id => $data ) {
		if ( !isset($sizes[$id]) )
			$sizes[$id] = ucfirst( str_replace( '-', ' ', $id ) );
	}

	return $sizes;
}
 
PREVIOUS NEXT
Tagged: #powerpack #add #custom #image #size
ADD COMMENT
Topic
Name
1+2 =