'ASC',
'orderby' => 'menu_order ID',
'id' => $post->ID,
'itemtag' => 'dl',
'icontag' => 'dt',
'captiontag' => 'dd',
'columns' => 3,
'size' => 'thumbnail',
'include' => '',
'exclude' => ''
), $attr));
$id = intval($id);
if ('RAND' == $order)
$orderby = 'none';
if (!empty($include)) {
$include = preg_replace('/[^0-9,]+/', '', $include);
$_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
$attachments = array();
foreach ($_attachments as $key => $val) {
$attachments[$val->ID] = $_attachments[$key];
}
}
if (empty($attachments))
return '';
$extra_class = '';
if (isset($attr['extra_class'])) {
$extra_class .= ' ' . $attr['extra_class'];
}
$output = '
';
$output .= '
"; //closes container and row
return $output;
}
function register_gallery_styles() {
wp_enqueue_style('bmatters-gallery', get_template_directory_uri() . '/assets/css/gallery.css');
}
function gallery_overflow_caption($attachments, $row_class, $thumb_size) {
$output = '';
foreach ($attachments as $id => $attachment) {
$img = wp_get_attachment_image_src($id, $thumb_size);
$output .= '';
$output .= '
';
$output .= '
';
$output .= $attachment->post_excerpt;
$output .= '
'; //closes caption
$output .= '
';
$output .= '

';
$output .= '
';
$output .= '
'; //closes thumbnail
$output .= '
'; //closes row
}
return $output;
}
function gallery_default($attachments, $row_class, $thumb_size) {
$output = '';
foreach ($attachments as $id => $attachment) {
$img = wp_get_attachment_image_src($id, $thumb_size);
$output .= '';
$output .= '

';
$output .= '
';
}
return $output;
}