add_filter('get_image_tag', 'add_image_frames', 10, 6); function add_image_frames($html, $id, $alt, $title, $align, $size) { list($img_src, $width, $height) = image_downsize($id, $size); $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id; $class = apply_filters('get_image_tag_class', $class, $id, $align, $size); $before = '
'; $after = '
'; $html = $before . $html . $after; return $html; }