daniofilho
4/12/2016 - 11:39 AM

WP Image Resizer

$url = 'http://yourwordpressdomain.com/wp-content/uploads/01/image1.png';      // Required
$width = 300;                                                                  // Optional. Defaults to '150'
$height = 200;                                                                 // Optional. Defaults to '150'
$crop = true;                                                                  // Optional. Defaults to 'true'
$retina = false;                                                               // Optional. Defaults to 'false'

// Call the resizing function (returns an array)
$image = matthewruddy_image_resize( $url, $width, $height, $crop, $retina );

// Outputs resized image URL, http://yourwordpressdomain.com/wp-content/uploads/01/image1-300x200.png
echo $image['url'];


//If all goes well, $image will contain 4 values, $image['url'], $image['width'], $image['height'] and $image['type'] respectively. These are pretty self explainatory.