Want more features on Pastebin? Sign Up, it's FREE!
Guest

Giovanni

By: a guest on Mar 16th, 2010  |  syntax: PHP  |  size: 0.89 KB  |  views: 1,489  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data