Skip to content

cmorgan8506/Wp-Image-Crop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WP Image Crop

WP Image Crop is a plugin developed to size and crop images in WordPress themes on the fly. The plugin is designed to give theme developers an easy to use tool when dealing with multiple image sizes and aspect ratios through out their WordPress themes. WP Image Crop also has a white list feature that allows you to use images from external sources securely, as well as, delegating a CDN url to use for sized images.

How to use it

Download, install, and activate the plugin.

Example: Size and display image

if( class_exists( 'WP_Image_Crop' ) ) {
    $imagesizer = New WP_Image_Crop;
    $imagesizer->sized_image( wp_get_attachment_url( get_post_thumbnail_id() ), 200, 200 );
}

Example: Size image and return url

if( class_exists( 'WP_Image_Crop' ) ) {
    $imagesizer = New WP_Image_Crop;
    $url = $imagesizer->get_sized_image( wp_get_attachment_url( get_post_thumbnail_id() ), 200, 200 );
}

Function Options:

sized_image( $url = null, $width = 150, $height = 150 )
get_sized_image( $url = null, $width = 150, $height = 150 )

WordPress Versions Supported: 3.0+

About

A WordPress plugin that allows you to crop images on the fly.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published