This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: Image Sizes

#1271
Jason Bobich
Keymaster

Just read your reply. I will try the priority trick (if I can figure it out… I’m not a coder, just fumbling around here!)

Ok, do this:

1) Open up the functions.php of the new Child theme example. See the top section where the framework is included. Copy this section to the top your Child theme’s functions.php.

2) Now place your code after this section you just pasted in:

// Image Sizes
function my_image_sizes( $sizes ) {
	$sizes['slider-large']['width'] = 921;
	$sizes['slider-large']['height'] = 275;
	$sizes['slider-large']['crop'] = true;
	$sizes['slider-staged']['width'] = 530;
	$sizes['slider-staged']['height'] = 235;
	$sizes['slider-staged']['crop'] = true;
	$sizes['large']['width'] = 918;
	$sizes['large']['height'] = 9999;
	$sizes['medium']['width'] = 668;
	$sizes['medium']['height'] = 9999;
	$sizes['grid_4']['width'] = 271;
	$sizes['grid_4']['height'] = 170;
	$sizes['grid_4']['crop'] = true;
	$sizes['grid_6']['width'] = 315;
	$sizes['grid_6']['height'] = 197;
	$sizes['grid_6']['crop'] = true;
	return $sizes;
}
add_filter( 'themeblvd_image_sizes', 'my_image_sizes' );

======

The reason for this is because WordPress loads the Child theme’s functions.php first. So for example, if you were to add a filter to change the slider image size, then after that the theme adds its filter to change the slider image size on the framework. So your filter becomes irrelevant.

However, by including the framework’s themeblvd.php at the top of your child theme, we’re reversing this process. Now the Parent theme comes first and now all of your Child theme’s functions come after.

=====

Also remember that image size changes don’t happen instantly. You have to either re-upload the images or re-generate your thumbnails. — http://wordpress.org/extend/plugins/regenerate-thumbnails/