resize from small images to large

Found a solution here that is working: http://www.binarynote.com/how-to-perfectly-upscale-image-in-wordpress.html function binary_thumbnail_upscale( $default, $orig_w, $orig_h, $new_w, $new_h, $crop ) { if ( !$crop ) return null; $aspect_ratio = $orig_w / $orig_h; $size_ratio = max($new_w / $orig_w, $new_h / $orig_h); $crop_w = round($new_w / $size_ratio); $crop_h = round($new_h / $size_ratio); $s_x = floor( ($orig_w – $crop_w) / 2 … Read more

Show ids of displayed media library items

Actually, wordpress stores the media library files also as a post format. so you can follow this way to get your attachment media file and their id’s. Hope this will help you. function get_images_from_media_library() { $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ =>’image’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => 5, ‘orderby’ => ‘rand’ ); $query_images = … Read more