0

Is there any alternative to timthumb?

Or how can i call an image into a div without it?

<img class="centerimage" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=250&amp;w=200&amp;zc=1" alt=""  />

I made a custom template, based on another one, it still uses tmthumb, is there any way to load an image without it?

Thanks in advance.

NeoVe
  • 3,857
  • 8
  • 54
  • 134

1 Answers1

2

Use WP 3.5's native image resizing.

See http://matthewruddy.github.io/Wordpress-Timthumb-alternative/

$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'];
markratledge
  • 17,322
  • 12
  • 60
  • 106