Hero image cropped at different dimensions

Instead of creating a new image size or uploading a completely different image just for mobile you might want to play around with object-fit and object-position CSS. object-fit and object-position work basically the same as background-size and background-position but instead of being applied to background-image’s only they work on objects like the <img> tag. Use … Read more

add_image_size() to crop images into squares?

If you pass true for the last $crop argument then so called “hard” crop mode is used. This will make WP produce results at exact size specified, except few edge cases (if image uploaded is smaller than specified size for example). Note that original image is still retained as is. If you need to actually … Read more

Confusion about arguments sent to add_image_size

As @PieterGoosen said, your point is valid. A look into the source confirms that the codex description of add_image_size was wrong there. It was, because I changed it to be correct. That said, everyone can help improving the codex, you just need to register. You might want to take a look at Contributing to WordPress … Read more

Local WordPress installation doesn’t crop images

For the record since I ended up here when experiencing the same issue on my localhost: In php.ini, Uncomment the line with: extension=php_gd2.dll Restart apache / all services This sorted it out for me (I may have switched a few other services on while I was there, but I believe this is what fixed it!)

Generated media have incorrect aspect ratio

Under settings >> media, change the height attributes to 9999, and untick Crop thumbnail to exact dimensions (normally thumbnails are proportional) under the thumbnail size if it is ticked. When you are done, download and install “Force Regenerate Thumbnails”. This is actually better than “Regenerate Thumbnails” as it deletes all redundant image sizes.

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