-
Notifications
You must be signed in to change notification settings - Fork 0
/
partial-gallery.php
55 lines (37 loc) · 1.27 KB
/
partial-gallery.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Partial Template - Display the gallery slider for gallery post formats
*/
$image_ids = Bunyad::posts()->get_first_gallery_ids();
if (!$image_ids) {
return;
}
$images = get_posts(array(
'post_type' => 'attachment',
'post_status' => 'inherit',
'post__in' => $image_ids,
'orderby' => 'post__in',
'posts_per_page' => -1
));
?>
<div class="gallery-slider slider-arrows">
<div class="frame flexslider">
<ul class="slides">
<?php foreach ($images as $attachment): ?>
<li>
<a href="<?php echo wp_get_attachment_url($attachment->ID); ?>">
<?php if ((!in_the_loop() && Bunyad::posts()->meta('layout_style') == 'full') OR Bunyad::core()->get_sidebar() == 'none'): // largest images - no sidebar? ?>
<?php echo wp_get_attachment_image($attachment->ID, 'main-full'); ?>
<?php else: ?>
<?php echo wp_get_attachment_image($attachment->ID, 'main-slider'); ?>
<?php endif; ?>
<?php if ($attachment->post_excerpt): // caption ?>
<div class="caption"><?php echo $attachment->post_excerpt; ?></div>
<?php endif; ?>
</a>
</li>
<?php endforeach; // no reset query needed; get_posts() uses a new instance ?>
</ul>
</div>
</div>
<?php wp_reset_query(); ?>