New answers tagged add-image-size
$image_attributes = wp_get_attachment_image_src( $attachment_id, $size ); Returns an array containing:  => url  => width  => height  => boolean: true if $url is a re-sized image, false if it is the original. Even though you pass the $size as parameter, while returning; it returns the actual width and height of the image ...
I guess you can do that using CSS, use Inspect Element facility of browser to confirm. Let me know if you are looking for something else. This is not an answer, but I have low reputation to comment on your question.
Like it was said, WordPress only generate thumbnails in the new sizes of the new media uploaded. The old images' thumbs doesn't get generated automatically. For this situation, I strongly recommend the following plugin: http://wordpress.org/plugins/force-regenerate-thumbnails/ It is pretty simple and unobtrusive. It just adds a new item on the wp-admin ...
Put this in your theme functions file. It will stop Wordpress from creating anything but the 3 default sizes when uploading. When an image is then requested in a particular size, which is not yet generated, it will be created only that once. add_filter('image_downsize', 'ml_media_downsize', 10, 3); function ml_media_downsize($out, $id, ...
You have to add the metadata information with the new b&w thumbnail: $meta['sizes']['thumbnail-bw'] = array( 'width' => $meta['width'], 'height' => $meta['height'], 'file' => $file ); after generating the new image (after the switch block). There 's also a plugin, called Grayscale, that does exactly what you need.
There is such plugin: Dynamic Image Resizer so you could give it a try. But... it's old, not maintained since 2012-04-30 so I'm not sure if it still works. Normally when you upload an image to a WordPress site, it creates several differently sized versions of the image automatically. Themes can define custom image sizes as well, increasing the amount ...
Top 50 recent answers are included