New answers tagged

0

Alternative solution here: http://pixert.com/blog/cropping-post-featured-thumbnails-from-top-instead-of-center-in-wordpress-with-native-cropping-tool/ Just add this code to functions.php, then use "Regenerate Thumbnails" plugin (https://wordpress.org/plugins/regenerate-thumbnails/): function px_image_resize_dimensions( $payload, $orig_w, $orig_h, $dest_w, ...


0

Just gong to post the answer here too. @Dan linked to another question that had the answer. Here's some documentation on the new responsive images feature: Responsive Images in WordPress 4.4 The default max-size that will go into a srcset is 1600px wide. So if you plan on using images that are bigger than that, you need to change that. It can be changed ...


0

There is little difference, by default crop is set to false. function add_image_size( $name, $width = 0, $height = 0, $crop = false ) { global $_wp_additional_image_sizes; $_wp_additional_image_sizes[ $name ] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => $crop, ); } And also ...


0

Sounds like you don't have an image library enabled with PHP (that probably should have generated some errors so maybe first look at your php error logs). Checkout if GD2 is enabled in your php.ini file.


0

No, the wp_get_attachment_image_src function calls image_downsize, which in turn calls image_get_intermediate_size itself. It doesn't cause generation of the images, it is simply getting the relevant images from the meta and choosing the correct one to use.


1

Unfortunately @Patrick's answer breaks the srcset functions introduced in WP 4.4. Fortunately, we just need to add two additional functions! First, we need to temporarily re-introduce all of the registered thumbnail sizes to the image metadata so they can be considered: function bi_wp_calculate_image_srcset_meta($image_meta, $size_array, $image_src, ...


1

The problem is that you are using functions from GD library to manipulate images, not functions from WordPress Image API (WP_Image_Editor class). So, WordPress things doesn't apply to the generated image by your code. WordPress Image API uses ImageMagick if available, otherwise it uses GD library. In order to keep EXIF data: If GD library is used, you ...


0

In you functions.php you need to add the following line; add_image_size('NAME',SIZE_WIDTH,SIZE_HEIGHT,HARD_CROP); This gives next example; add_image_size('new_format',600); (The last 2 parameters are optional) If you already have images in you media library, you need to regenerate the thumbnails. You can do this with the plugin ...


0

I've seen this kind of sites or even worked on it. You can add custom sizes from your theme's functions.php file using add_image_size(). This may help you https://developer.wordpress.org/reference/functions/add_image_size/ Based on your requirement I think this would help you too http://www.wpexplorer.com/wordpress-image-crop-sizes/ Feel free to ask any ...


-1

You should not assume that image related metadata survives the wordpress image manipulation. As you found out it depends on the image manipulation library installed on the server, and actually in version 4.5 the aim would be to strip some of it as noted here https://make.wordpress.org/core/2016/03/12/performance-improvements-for-images-in-wordpress-4-5/. If ...



Top 50 recent answers are included