Index: wp-includes/media.php =================================================================== --- wp-includes/media.php (revision 11181) +++ wp-includes/media.php (working copy) @@ -610,6 +610,9 @@ */ function gallery_shortcode($attr) { global $post; + + static $instance = 0; + $instance++; // Allow plugins/themes to override the default gallery template. $output = apply_filters('post_gallery', '', $attr); @@ -651,26 +654,28 @@ $captiontag = tag_escape($captiontag); $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; + + $selector = "gallery-{$instance}"; $output = apply_filters('gallery_style', " -