JoeHana
4/10/2013 - 5:01 PM

Frameshift Image Sizes

Frameshift Image Sizes

<?php

/**
 * Frameshift Image Sizes
 */

add_filter('frameshift_image_sizes', 'custom_image_sizes');

function custom_image_sizes($image_sizes) {
	
	// Image sizes when layout is set to four columns

	if( FRAMESHIFT_LAYOUT == 'four' ) {

		$image_sizes = array(
			'post-thumbnail' => array(
				'size' => array(
					'w' => 215,
					'h' => 120
				),
				'crop'  => true,
				'label' => __( 'small', 'frameshift' )
			),
			'half' => array(
				'size' => array(
					'w' => 470,
					'h' => 265
				),
				'crop'  => true,
				'label' => __( 'half', 'frameshift' )
			),
			'big' => array(
				'size' => array(
					'w' => 725,
					'h' => 410
				),
				'crop'  => true,
				'label' => __( 'big', 'frameshift' )
			),
			'full' => array(
				'size' => array(
					'w' => 1060,
					'h' => 450
				),
				'crop'  => true,
				'label' => __( 'full', 'frameshift' )
			)
		);
		
	// Image sizes when layout is set to three columns
	
	} else {
	
		$image_sizes = array(
			'post-thumbnail' => array(
				'size' => array(
					'w' => 360,
					'h' => 167
				),
				'crop'  => true,
				'label' => __( 'small', 'frameshift' )
			),
			'half' => array(
				'size' => array(
					'w' => 470,
					'h' => 265
				),
				'crop'  => true,
				'label' => __( 'half', 'frameshift' )
			),
			'big' => array(
				'size' => array(
					'w' => 640,
					'h' => 360
				),
				'crop'  => true,
				'label' => __( 'big', 'frameshift' )
			),
			'full' => array(
				'size' => array(
					'w' => 1080,
					'h' => 450
				),
				'crop'  => true,
				'label' => __( 'full', 'frameshift' )
			)
		);	
	
	}
	
	return $image_sizes;
}