try something like this:
if( FALSE === get_option("frontpage_size_w") )
{
add_option("frontpage_size_w", "260");
add_option("frontpage_size_h", "0");
add_option("frontpage_size_crop", "0");
}
else
{
update_option("frontpage_size_w", "260");
update_option("frontpage_size_h", "0");
update_option("frontpage_size_crop", "0");
}
function additional_image_sizes( $sizes )
{
$sizes[] = "frontpage";
return $sizes;
}
add_filter( 'intermediate_image_sizes', 'additional_image_sizes' );
the above example will add size called “frontpage” to the list of image sizes. for each additional image size, you will have to add its name to the $sizes array and add its width, height and crop values to wp’s options.
like this:
if( FALSE === get_option("frontpage_size_w") )
{
add_option("frontpage_size_w", "260");
add_option("frontpage_size_h", "0");
add_option("frontpage_size_crop", "0");
add_option("anothersize_size_w", "260");
add_option("anothersize_size_h", "0");
add_option("anothersize_size_crop", "0");
}
else
{
update_option("frontpage_size_w", "260");
update_option("frontpage_size_h", "0");
update_option("frontpage_size_crop", "0");
update_option("anothersize_size_w", "260");
update_option("anothersize_size_h", "0");
update_option("anothersize_size_crop", "0");
}
function additional_image_sizes( $sizes )
{
$sizes[] = "frontpage";
$sizes[] = "anothersize";
return $sizes;
}
add_filter( 'intermediate_image_sizes', 'additional_image_sizes' );
you can put this code in the functions.php file, or create a plugin out of it.
cheers ??