forked from dimsemenov/Touchfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ds-gallery-template.php
50 lines (50 loc) · 1.19 KB
/
ds-gallery-template.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
<?php
/**
*
* Template Name: Gallery Page
*
* The template for displaying gallery page with sliding images.
*
* @package dsframework
* @since dsframework 1.0
*
*/
?>
<?php get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<div id="main-slider" class="two-dim-slider">
<div class="slider-data">
<ul class="two-dim-albums-list">
<?php
$gallery_cats = get_ds_option( 'album_cats_gallery_page' );
if( $gallery_cats ) {
$tax_query = array(
'relation' => 'AND',
array(
'taxonomy' => 'ds-gallery-category',
'field' => 'slug',
'terms' => preg_split("/\s*,\s*/", $gallery_cats),
'include_children' => true,
'operator' => 'IN'
)
);
} else {
$tax_query = '';
}
$loop = new WP_Query( array(
'post_type' => 'ds-gallery',
'posts_per_page' => -1,
'tax_query' => $tax_query
));
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php get_template_part( 'content', 'ds-gallery' ); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</ul>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>