Responsive Image cropped
-
Hey there,
I want to load the cropped version of an image if user has mobile viewport.
So first i have added this code to deactivated WP image size.
add_action('init', 'remove_default_image_sizes'); function remove_default_image_sizes() { remove_image_size('thumbnail'); remove_image_size('medium'); remove_image_size('medium_large'); remove_image_size('large'); }
After that i add for my test case following code.
add_action( 'after_setup_theme', 'wpdocs_theme_setup' ); function wpdocs_theme_setup() { add_image_size( 'banner', 2400); add_image_size( 'banner-smartphone', 490, 250, true ); // (cropped) }
After that i see the original image, the big one and the smart one in my ftp folder.
But if i check HTML source code i only see the original and the big one. In my img tag.
Can someone tells me what i have made wrong or can show me a way how to handle it?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Responsive Image cropped’ is closed to new replies.