public static function resize($originalImage, $width, $height, $crop = true)
    {
        $imagePath = false;

        // Image from attachment id
        if (is_numeric($originalImage)) {
            $imagePath = wp_get_attachment_url($originalImage);
        } elseif (in_array(substr($originalImage, 0, 7), array('https:/', 'http://'))) {
            $imagePath = self::urlToPath($originalImage);
        }

        if (!$imagePath) {
            return false;
        }

        $imagePath = self::removeImageSize($imagePath);

        if (!file_exists($imagePath)) {
            return false;
        }

        $imagePathInfo = pathinfo($imagePath);

        $ext       = $imagePathInfo['extension'];
        $suffix    = "{$width}x{$height}";
        $destPath = "{$imagePathInfo['dirname']}/{$imagePathInfo['filename']}-{$suffix}.{$ext}";

        if (file_exists($destPath)) {
            return self::pathToUrl($destPath);
        }

        if (image_make_intermediate_size($imagePath, $width, $height, $crop)) {
            return self::pathToUrl($destPath);
        }

        return $originalImage;
    }