Hello,
I added a custom image size in my child theme function.php file, and I see it in my media settings in wordpress, but I can’t use it as an image size in the slider accordeon shortcode… what did I do wrong?
Thanks a lot
// add new size
add_image_size( ‘instinct_portraits’, 267, 400, false );
// make the new size available in the media library (and image element etc.)
add_filter( ‘image_size_names_choose’, ‘my_custom_sizes’ );
function my_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
‘instinct_portraits’ => __( ‘Instinct Portrait’ ),
) );
}
Hey!
Please replace the code with this:
// add new size
add_image_size( 'awesome-size', 1500, 630, true );
// make the new size available in the media library (and image element etc.)
add_filter( 'image_size_names_choose', 'my_custom_sizes' );
function my_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
'awesome-size' => __( 'Awesome Size' ),
) );
}
Upload the images again or regenerate them with a plugin.
Cheers!
Ismael