New answers tagged

0

If you wan use image from theme dir, then you should create all sizes image e.g. logo_300x300, logo_fullsize, logo_small,... You can upload image with media_handle_sideload function, more information https://codex.wordpress.org/Function_Reference/media_handle_sideload


0

add_image_size function has nothing to do with the images that are located in theme root directory. When you add add_image_size function , we are saying that : Hey WordPress! Can you please also re-size my uploaded images via WordPress admin to this particular size also hard crop the image if image size is bigger ( since third argument is set to true ). ...


-1

I managed that with css. This is how i did it: On your header.php file add a class to your image tag like this: img class="logo" src="" alt="" Then, on your style.css add the logo class: .logo { max-width: 200px; } If needs any change afterwards just go to the Editor and change the value directly in the style.css file.


-1

Here yet another approach: Its hooks into the 404 HTTP error handling. That is, when thumbnail is not available, find the original image and create the thumbnail. Note that this does not really solve your problem, as it does not preven thumbnail generation during upload. Note also that this plugin might be used by malicious users to create any number of ...


0

in my case, there was an error regenerating an image, because the image was too big! so the system did not regenerate smaller versions. you can see this happening, if the execution of the plugin regenerate thumbnails runns too fast on this particular image AND you can see via ftp, that there are NO smaller versions of the image. in this case, simply download ...


0

As far as i know it is possible with image_size_names_choose hook (see https://codex.wordpress.org/Plugin_API/Filter_Reference/image_size_names_choose). Example: // add your custom size function my_setup_image_sizes() { add_image_size( 'wide-image', 900, 0); } add_action( 'after_setup_theme', 'my_setup_image_sizes' ); // add custom size to editor image ...



Top 50 recent answers are included