Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_frame_image($atts, $content=""){
- extract(shortcode_atts(array(
- 'size' => '300*300',
- 'float' => 'none',
- 'type' => 'shadow',
- 'alt' => '',
- 'href' => '',
- 'title' => ''
- ), $atts));
- $size = explode('*',$size);
- $resized_img = get_template_directory_uri().'/truethemes_framework/extended/timthumb/timthumb.php?src='.$content.'&h='.$size[1].'&w='.$size[0];
- $framed = '';
- $framed .= '<div class="c_post_thumb f'.$size[0].'x'.$size[1].' f'.$float.' f'.$type.'">';
- $framed .= '<div class="post_thumb_load">';
- if(!empty($href)) $framed .= '<a href="'.$href.'" title="'.$title.'" class="attachment-fadeIn">';
- $framed .= '<img src="'.$resized_img.'" width="'.$size[0].'" height="'.$size[1].'" alt="'.$alt.'">';
- if(!empty($href)) $framed .= '</a>';
- $framed .= '</div>';
- $framed .= '</div>';
- return $framed;
- }
- add_shortcode('framed' ,'custom_frame_image');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement