Tag Info

New answers tagged

0

https://github.com/crstauf/WordPress-FeaturedImage-SpecialImageSize try this out; wrote it myself a long time ago. I do have an updated version, coming out soon. let me know if you've any questions.


0

After playing around a little more, the image does look like it's being resized by wordpress on upload to the 708 width, however, when inserted by the media library, the image is automatically scaled down to 474px which is the width of the text column. This is correct. Themes define a global variable called "$content_width" which tells WordPress ...


0

Try adding the custom image sizes using the after_setup_theme hook in WordPress. Off the top of my head you would add something like this to functions.php if(!function_exists('custom_after_theme_setup')): function custom_after_theme_setup(){ // your image size code here } add_action('after_theme_setup', 'custom_after_theme_setup'); endif; ...


1

Why do you need a plugin for that? Set image quality to 100% in WordPress with following code. function my_new_image_quality( $quality ) { return 100; } add_filter( 'jpeg_quality', 'my_new_image_quality' ); add_filter( 'wp_editor_set_quality', 'my_new_image_quality' ); Now when you upload a image, WordPress always crop your image for different ...


1

Wordpress resizes the images when you upload them based on the settings in the functions file in your active theme. If you switch themes it might resize everything again leading to the many sizes, butI'm not sure if that is why you have so many strange sizes. This is the wordpress page related to the deprecated image function, and this is the newer ...


2

640px is the content size set in your functions.php. Here is an example of the content width set in the bundled theme twentyfourteen in twentyfourteen/functions.php#L28 if ( ! isset( $content_width ) ) { $content_width = 474; } In this example, the image size will be 474 px. The content size will be the size used when images are inserted as ...


3

In your handler, if you set 'error', the error message will be displayed and will cancel the upload add_filter( 'wp_handle_upload_prefilter', 'custom_upload_filter' ); function custom_upload_filter( $file ) { $image_info = getimagesize( $file['tmp_name'] ); $image_width = $image_info[0]; $image_height = $image_info[1]; if ( $image_with ...


0

Add your own custom sizes or modify the values for the existing sizes. You can use this code which includes a parameter to hard crop your images in different positions: add_image_size( 'custom-size', 220, 220, array( 'left', 'top' ) ); // Hard crop left top



Top 50 recent answers are included