'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => '', 'icontag' => '', 'captiontag' => '', 'columns' => 4, 'size' => 'thumbnail', 'include' => '', 'exclude' => '', 'link' => 'file' ), $attr)); $id = intval($id); $columns = (12 % $columns == 0) ? $columns: 4; $grid = sprintf('col-sm-%1$s col-lg-%1$s', 12/$columns); if ($order === 'RAND') { $orderby = 'none'; } if (!empty($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]; } } elseif (!empty($exclude)) { $attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby)); } else { $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; } $unique = (get_query_var('page')) ? $instance . '-p' . get_query_var('page'): $instance; $output = '' : ''; $output .= ''; return $output; } if (current_theme_supports('bootstrap-gallery')) { remove_shortcode('gallery'); add_shortcode('gallery', 'roots_gallery'); add_filter('use_default_gallery_style', '__return_null'); } /** * Add class="thumbnail img-thumbnail" to attachment items */ function roots_attachment_link_class($html) { $postid = get_the_ID(); $html = str_replace('