Tag Info

New answers tagged

0

You could add a new image size with a hard crop added however it would be the same crop position for all images, setting them manually would require per image manipulation. add_image_size( 'blog-crop', 375, 0, array( 'left', 'top' ) ); Then reference the new image size in your blog template. Codex reference here: ...


0

Is the css clip property what you are looking for? img { position: absolute; clip: rect(0px,60px,200px,0px); } From CSS clip Property


0

If you have access to install, or if it is available on your server I would recommend using WP-CLI. It has a command to regenerate the media: wp media regenerate If not, you can try a plugin such as Regenerate Thumbnails Good luck!


1

You can get the original sizes of the image being uploaded: list( $uploaded_width, $uploaded_height ) = getimagesize( $_FILES['u_img']['tmp_name'] ); Then you can use those values to size the image as you like: $height = 300; $image = wp_get_image_editor( $_FILES['u_img']['tmp_name'] ); $image->resize( $uploaded_width, $height, true );


1

This function will generate an image by temporarily registering an image size, generating the image (if necessary) and the removing the size so new images will not be created in that size. function lazy_image_size($image_id, $width, $height, $crop) { // Temporarily create an image size $size_id = 'lazy_' . $width . 'x' .$height . '_' . ((string) ...



Top 50 recent answers are included