obarlas

Untitled

Oct 21st, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1.         /*
  2.  
  3.          * Edited by Omer Barlas
  4.  
  5.          * Original: $preview=get_post_meta($post->ID, 'preview_value', true);
  6.  
  7.          */
  8.  
  9.         if (has_post_thumbnail($post->ID)) {
  10.  
  11.             $image_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID));
  12.  
  13.             if (is_array($image_src)) {
  14.  
  15.                 $preview = $image_src[0];
  16.  
  17.             } else {
  18.  
  19.                 $preview = false;
  20.  
  21.             }
  22.  
  23.         } else {
  24.  
  25.             $preview = get_post_meta($post->ID, 'preview_value', true);
  26.  
  27.         }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment