Reputation: 138
I'm pulling through an image from the Wordpress Customiser into a plain old image tag:
<img src="<?php echo get_theme_mod( 'block_one_image', '/' ); ?>" class="responsive-image" alt="">
However, I want to crop the image using my custom image size, defined in my functions.php:
add_image_size( 'services_front_page', 360, 270 );
Can't seem to figure out how to tie the two together, though... any help would be massively appreciated!
Upvotes: 0
Views: 26
Reputation: 1273
If you want to pass the image as-is and then crop it on the browser use CSS styling.
If you want to pass the image cropped in the browser you will need to crop it on the server with synchronous processing and then pass the url to the cropped image to the browser.
The later is ill-advised from performance stand-point
Upvotes: 1