forked from dimsemenov/Touchfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ds-gallery-masonry-template.php
48 lines (48 loc) · 1.11 KB
/
ds-gallery-masonry-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
<?php
/**
*
* Template Name: Masonry Gallery Page
*
* The template for displaying gallery page with masonry layout.
*
* @package dsframework
* @since dsframework 1.0
*
*/
?>
<?php get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?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
));
?>
<section class="albums-thumbnails clearfix">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php get_template_part( 'content', 'masonry' ); ?>
<?php endwhile; ?>
</section>
<?php wp_reset_postdata(); ?>
<?php get_template_part( 'content', 'page-masonry' ); ?>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>