Advertisement
nefi_c

framed karma

Feb 21st, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. function custom_frame_image($atts, $content=""){
  2.     extract(shortcode_atts(array(
  3.         'size' => '300*300',
  4.         'float' => 'none',
  5.         'type' => 'shadow',
  6.         'alt' => '',
  7.         'href' => '',
  8.         'title' => ''
  9.      ), $atts));
  10.    
  11.     $size = explode('*',$size);
  12.     $resized_img = get_template_directory_uri().'/truethemes_framework/extended/timthumb/timthumb.php?src='.$content.'&h='.$size[1].'&w='.$size[0];
  13.    
  14.     $framed = '';
  15.     $framed .= '<div class="c_post_thumb f'.$size[0].'x'.$size[1].' f'.$float.' f'.$type.'">';
  16.         $framed .= '<div class="post_thumb_load">';
  17.             if(!empty($href)) $framed .= '<a href="'.$href.'" title="'.$title.'" class="attachment-fadeIn">';
  18.                 $framed .= '<img src="'.$resized_img.'" width="'.$size[0].'" height="'.$size[1].'" alt="'.$alt.'">';
  19.             if(!empty($href)) $framed .= '</a>';
  20.         $framed .= '</div>';
  21.     $framed .= '</div>';
  22.    
  23.     return $framed;
  24. }
  25. add_shortcode('framed' ,'custom_frame_image');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement