Thumbnails of same size with different crop

You can define your own cropping sizes but you can create a function that accepts image size + image position and then load your images accordingly. For example- <?php $size=”medium”; $pos = array( ‘top’ => ‘100’, ‘left’ => ‘100’ ); function load_image_with_pos( $img_id, $size, $pos ) { $img_src = wp_get_attachment_image_src( $img_id, $size ); $new_img = … Read more

Is there a hook which fires after all thumbnails are generated?

Thumbnails in WordPress can be generated by using wp_generate_attachment_metadata(), this function fires a filter after generating all the thumbnails wp_generate_attachment_metadata and the filter provides $metadata and $attachment_id to the hooked functions. You can hook your custom function to this filter. $metadata : Attachment metadata. What you need is $metadata[‘sizes’][‘<size-name>’], the <size-name> is the name of … Read more

How to set thumbnail image for a (child) theme

Create image file in PNG Format having name screenshot.png and save it in themes root folder.The recommended image size is 880×660. Even recommended image size is 880×660 though it will only be shown as 387×290 but the double-sized image allows for high-resolution viewing on HiDPI displays. For more information see this page. If you don’t … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)