I have put add_image_size('image_horizontal', 750, 300, false);
in functions.php file but it doesn't appear as selection when publishing new post and adding image in the post, all I see is thumbnail, large and full size. I don't want to change default image sizes, just add this one with others. I did regenerate thumbnails using a plugin after. Does putting a custom image size in selection needs different code?
1 Answer
You also need to add it to image size chooser.You can do so using the filter image_size_names_choose.
add_filter( 'image_size_names_choose', 'wpse_228675_custom_size' );
function wpse_228675_custom_size( $sizes ) {
return array_merge( $sizes, array(
'image_horizontal' => __('Custom image size'),
) );
}
after_setup_theme
.