Firstly, I would recommend making these modifications in a plugin, or more easily, in your theme's functions.php.
From the link you provided, I've taken a guess at what you are after. Copy the below into your theme's functions.php and see how it goes!
Note: I have removed the <style>..</style> tags from the gallery output. You should put the CSS you require in your theme's style.css.
function tt_gallery_shortcode($attr)
{
global $post;
static $instance = 0;
$instance++;
// Allow plugins/themes to override the default gallery template.
$output = apply_filters('post_gallery', '', $attr);
if ( $output != '' )
return $output;
// We're trusting author input, so let's at least make sure it looks like a valid orderby statement
if ( isset( $attr['orderby'] ) ) {
$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
if ( !$attr['orderby'] )
unset( $attr['orderby'] );
}
extract(shortcode_atts(array(
'order' => 'ASC',
'orderby' => 'menu_order ID',
'id' => $post->ID,
'itemtag' => 'div',
'icontag' => 'span',
'captiontag' => 'span',
'columns' => 3,
'size' => 'thumbnail'
), $attr));
$id = intval($id);
$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
if ( empty($attachments) )
return '';
if ( is_feed() ) {
$output = "\n";
foreach ( $attachments as $att_id => $attachment )
$output .= wp_get_attachment_link($att_id, $size, true) . "\n";
return $output;
}
$itemtag = tag_escape($itemtag);
$captiontag = tag_escape($captiontag);
$columns = intval($columns);
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
$selector = "gallery-{$instance}";
$output = apply_filters('gallery_style', "
<div id='$selector' class='gallery galleryid-{$id}'>");
$i = 0;
foreach ( $attachments as $id => $attachment ) {
$link = wp_get_attachment_link($id, $size, true, false);
$link_caption = "<{$captiontag} class='desc'>" . wptexturize($attachment->post_excerpt) . "</{$captiontag}>";
// splice the caption inside the anchor tag
$link = preg_replace('|</a>|', $link_caption . '</a>', $link);
$output .= "<{$itemtag} class='gallery-item imgteaser'>
";
$output .= $link;
$output .= "</{$itemtag}>
";
if ( $columns > 0 && ++$i % $columns == 0 )
$output .= '<br style="clear: both" />';
}
$output .= "
<br style='clear: both;' />
</div>\n";
return $output;
}
add_shortcode('gallery', 'tt_gallery_shortcode');