The shortcode supports specifying the gallery’s id by supplying the
id
parameter. More on this in the documentation.
However, using id
might be contra productive if you wish to use two different styles of galleries across your site, in which case you would need to use the same style for a whole lot of #ids
in your CSS – which you might not even know beforehand. Unfortunately there is not class
attribute available. To accomodate this need you could remove the default gallery shortcode and add your own shortcode handler function replicating the functionality of gallery_shortcode
while adding support for a class
parameter or what you might need.
remove_shortcode('gallery', 'gallery_shortcode');
add_shortcode('gallery', 'my_gallery_shortcode');
function my_gallery_shortcode($attr) {
...
}
EDIT: Another, perhaps simpler, option to accomplish the same thing would be the create a wrapper shorttag for gallery
:
add_shortcode('my_gallery', 'my_gallery_shortcode');
function my_gallery_shortcode($attr) {
$attr = shortcode_atts(array('class' => 'gallery-wrapper'), $attr);
$class = $attr['class'];
unset($attr['class']);
return '<div class="' . $class . '">' . gallery_shortcode($attr) . '</div>';
}