-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-gallery.php
54 lines (40 loc) · 1.63 KB
/
template-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
<?php
/*
Template Name: Gallery Page
*/
?>
<?php get_header();?>
<section class="page-wrap">
<div class="container">
<section class="row">
<div class="col-lg-3">
<?php if (is_active_sidebar('page-sidebar')):?>
<?php dynamic_sidebar('page-sidebar');?>
<?php endif;?>
</div>
<div class="col-lg-9 ">
<?php
$args = array(
'numberposts' => -1, //Using -1 loads all posts
'orderby' => 'menu_order', //This ensures images are in the order set in the page media manager
'order' => 'ASC',
'post_mime_type' => 'image', // make sure it doesn't pull other resources, like videos
'post_parent' => $post->ID, // Important part - ensures the associated images are loaded
'post-status' => null,
'post-type' => 'attachement'
);
$images = get_children($args);
if ($images) { ?>
<div id="slider">
<?php foreach ($images as $image) { ?>
<img src="<?php echo $image->guid; ?>" alt="<?php echo $image->post_title; ?>" title="<?php echo $image->post_title; ?>" />
<?php } ?>
</div>
<?php } ?>
<h1><?php the_title();?></h1>
<?php get_template_part('includes/section', 'content');?>
</div>
</section>
</div>
</section>
<?php get_footer(); ?>