Filter by featured image size
-
Hi,
this plugin may come in handy. Due to a theme change on my site some old posts have to small original sizes, now. It would be nice to be able to display all posts with an original image smaller than a size given as width and height in pixel (e.g. 400×600).
I think function wp_get_attachment_image_src() may be used for this:
$arrImage = wp_get_attachment_image_src( $attachment_id, array($min_width, $min_height)); if (empty($arrImage)) { return ''; } $url = $arrImage[0]; $width = $arrImage[1]; $height = $arrImage[2]; $resized = $arrImage[3]; return (!$resized && ($width < $min_width || $height < $min_height)) ? $url : '';
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Filter by featured image size’ is closed to new replies.