the_permalink(); ?> " rel="bookmark"> <small><i class="icon-bookmark"></i><?php _e('Permalink', 'firmasite'); ?> </small> </a> <?php } ?> </div> <div class="entry-meta"> <small> <?php echo firmasite_gallery_count($post->ID, "label label-success"); ?> <?php do_action('open_entry_meta'); ?> <?php $categories = get_the_category(); if ($categories) { echo '<span class="loop-category"><span class="icon-folder-open"></span> ' . ' '; foreach ($categories as $category) { echo '<a class="label label-' . $firmasite_settings["color-tax"] . '" href="' . get_category_link($category->term_id) . '">'; echo '<span>' . $category->name . '</span>'; echo '</a> '; } echo "</span>"; }
function firmasite_post_gallery($output, $attr) { global $post, $wp_locale; static $instance = 0; $instance++; // 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']); } } $attr = apply_filters("firmasite_gallery_attr", $attr); extract(shortcode_atts(array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'h4', 'columns' => 3, 'size' => 'large', 'include' => '', 'exclude' => '', 'link' => 'none'), $attr)); $id = intval($id); if ('RAND' == $order) { $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; } $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); /* $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $float = is_rtl() ? 'right' : 'left'; */ $selector = "gallery-{$post->ID}-{$instance}"; $total_images = count($attachments); $output = "<div id='{$selector}' class='carousel slide' data-rel='carousel'>"; if ($total_images > 1) { $i = 0; $gallery_slide_active = " active"; $output .= '<ol class="carousel-indicators">'; foreach ($attachments as $id => $attachment) { $output .= "<li data-target='#{$selector}' data-slide-to='{$i}' class='{$gallery_slide_active}'></li>"; $i++; $gallery_slide_active = ""; // only first item } $output .= '</ol>'; } $output .= '<div class="carousel-inner">'; $i = 0; $gallery_slide_active = " active"; foreach ($attachments as $id => $attachment) { //$link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); if (!isset($attr['link'])) { $attr['link'] = "post"; } switch ($attr['link']) { case 'file': $link = wp_get_attachment_link($id, $size, false, false); break; case 'none': $link = wp_get_attachment_image($id, $size); break; default: case 'post': $link = wp_get_attachment_link($id, $size, true, false); break; } $output .= "<div class='thumbnail item {$gallery_slide_active}'>"; $gallery_slide_active = ""; // only first item //$output .= " <img src='assets/img/bootstrap-mdo-sfmoma-01.jpg' alt=''>"; $output .= $link; //$output .= "<h4>First thumbnail label</h4>"; if ($captiontag && (trim($attachment->post_excerpt) || trim($attachment->post_title))) { $output .= "<div class='carousel-caption'>"; if (trim($attachment->post_title)) { $output .= "\r\n\t\t\t\t\t\t<{$captiontag} class='wp-title-text gallery-title'>\r\n\t\t\t\t\t\t" . wptexturize($attachment->post_title) . "\r\n\t\t\t\t\t\t</{$captiontag}>"; } if (trim($attachment->post_excerpt)) { $output .= "\t\t\t\t\t\t\r\n\t\t\t\t\t\t<p class='wp-caption-text gallery-caption'>\r\n\t\t\t\t\t\t" . wptexturize($attachment->post_excerpt) . "\r\n\t\t\t\t\t\t</p>"; } $output .= "</div>"; } $output .= "</div>"; } $output .= "</div>"; $output .= "<!-- Carousel nav -->"; if ($total_images > 1) { $output .= "<a class='carousel-control left' href='#{$selector}' data-slide='prev'><span class='icon-prev'></span></a>"; $output .= "<a class='carousel-control right' href='#{$selector}' data-slide='next'><span class='icon-next'></span></a>"; } $output .= "</div>"; if ($total_images > 1) { $output .= firmasite_gallery_count($post->ID, "label label-success", $total_images); } $output .= "<hr />\n"; return $output; }
} echo "<div class='thumbnail item {$gallery_slide_active}'>"; $gallery_slide_active = ""; // only first item //echo " <img src='assets/img/bootstrap-mdo-sfmoma-01.jpg' alt=''>"; echo $image_output; //echo "<h4>First thumbnail label</h4>"; if (trim($attachment->post_excerpt)) { echo "<div class='carousel-caption'>"; if (trim($attachment->post_excerpt)) { echo "\n\t\t\t\t\t\t<h4 class='wp-title-text gallery-title'>\n\t\t\t\t\t\t" . wptexturize($attachment->post_excerpt) . "\n\t\t\t\t\t\t</h4>"; } echo "</div>"; } echo "</div>"; } ?> </div> <!-- Carousel nav --> <?php if ($total_images > 1) { echo "<a class='carousel-control left' href='#{$selector}' data-slide='prev'><span class='icon-prev'></span></a>"; echo "<a class='carousel-control right' href='#{$selector}' data-slide='next'><span class='icon-next'></span></a>"; } ?> </div> <?php if ($total_images > 1) { echo firmasite_gallery_count($post->ID, "text-muted", $total_images); }