SHARE
TWEET

Giovanni

a guest Mar 16th, 2010 1,786 Never
  1. function arras_get_thumbnail($w = 630, $h = 250) {
  2.         global $post;
  3.                
  4. if ( function_exists('has_post_thumbnail') && has_post_thumbnail($post->ID) ) {
  5.  $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), full );
  6.  
  7.                 if (!$thumbnail[0]) return false;
  8.         else return get_bloginfo('template_directory') . '/library/timthumb.php?src=' . $thumbnail[0] . '&w=' . $w . '&h=' . $h . '&zc=1';
  9.  
  10.  } else {
  11.  $thumbnail = get_post_meta($post->ID, ARRAS_POST_THUMBNAIL, true);
  12.  }
  13.        
  14.         if      (!$thumbnail) {
  15.         return false;
  16.         } else {
  17.                 if (ARRAS_THUMB == 'phpthumb') {
  18.                         return get_bloginfo('template_directory') . '/library/phpthumb/phpThumb.php?src=' . $thumbnail . '&w=' . $w . '&h=' . $h . '&zc=1';
  19.                 } else {
  20.                         return get_bloginfo('template_directory') . '/library/timthumb.php?src=' . $thumbnail . '&w=' . $w . '&h=' . $h . '&zc=1';
  21.                 }
  22.         }
  23. }
RAW Paste Data
Top