-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive-artist.php
158 lines (138 loc) · 4.51 KB
/
archive-artist.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php
wp_enqueue_script( 'nicescroll', get_theme_file_uri( '/assets/js/nicescroll/dist/jquery.nicescroll.min.js' ), array('jquery'), '', false );
get_header();
$terms = get_terms( 'artist_categories', array(
'hide_empty' => true,
));
set_query_var( 'placeholderPageId', 91 );
get_template_part( 'template-parts/page/content', 'header' );
?>
<section id="artists-list" class="section-padding max-width">
<div class="btn-toolbar filters">
<div data-toggle="buttons" class="btn-group">
<label class="btn on">
<input type="radio" name="filter" value="*" checked="checked">
Wszyscy
</label>
<?php foreach ($terms as $term) : ?>
<label class="btn">
<input type="radio" name="filter" value="<?php echo $term->slug; ?>">
<?php echo $term->name; ?>
</label>
<?php endforeach; ?>
</div>
</div>
<div class="container-fluid">
<div id="artists-grid" class="row">
<?php while ( have_posts() ) : the_post(); ?>
<?php $aterms = get_the_terms(get_the_ID(), 'artist_categories'); ?>
<div class="col-xs-12 col-sm-4 col-md-3 artist-item<?php foreach ($aterms as $t) echo ' '.$t->slug; ?>">
<div class="content-box" data-mfp-src="#test-popup-<?php the_ID(); ?>">
<div class="bg" style="background-image: url('<?php the_post_thumbnail_url(); ?>');"></div>
<div class="gradient-cover"></div>
<div class="content">
<h4><?php the_title(); ?></h4>
<?php foreach ($aterms as $cat) echo '<div class="category">'.$cat->name.'</div>'; ?>
<div class="excerpt">
<?php the_excerpt(); ?>
</div>
</div>
</div>
<div id="test-popup-<?php the_ID(); ?>" class="black-popup max-width mfp-hide">
<div>
<div class="table">
<div class="cell img-wrap"><?php the_post_thumbnail(); ?></div>
<div class="cell"><div class="content">
<?php the_title('<h3>', '</h3>');
foreach ($aterms as $cat) echo '<div class="category">'.$cat->name.'</div>';
the_content(); ?>
</div></div>
</div>
</div>
</div>
</div>
<?php endwhile; // End of the loop.?>
</div>
</div>
<script>
(function($) {
var $grid = jQuery('#artists-grid');
$grid.isotope({
// options
itemSelector: '.artist-item',
layoutMode: 'masonry'
});
$('.filters input').change(function() {
$(this).parent().siblings().removeClass('on');
$(this).parent().toggleClass('on');
var value = $(this).val();
if ( value != '*' ) value = '.' + value;
$grid.isotope({ filter: value });
});
})(jQuery);
(function($) {
$(document).ready(function() {
var $contentElements = $('#artists-grid .content')
/*
$contentElements.niceScroll({
cursorcolor: '#ffe2a680',
cursorborder: '1px solid #ffe2a680',
});
console.log($contentElements.getNiceScroll());
*/
$('#artists-grid').magnificPopup({
delegate: 'div.content-box',
disableOn: 700,
type: 'inline',
closeMarkup: '<button title="Zamknij (Esc)" type="button" class="mfp-close"><i class="icon-close"></i></button>',
mainClass: 'mfp-fade',
removalDelay: 160,
callbacks: {
open: function() {
var container = $(this.content.get()).find('.content');
container.niceScroll({
cursorcolor: '#ffe2a680',
cursorborder: '1px solid #ffe2a680',
});
container.getNiceScroll().resize();
console.log(container.width() + ' / ' + container.height());
console.log(container.getNiceScroll());
},
},
/*
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false,
*/
});
/*
$('#gallery-grid').magnificPopup({
delegate: 'a',
disableOn: 700,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false,
iframe: {
markup: '<div class="mfp-iframe-scaler">'+
'<div class="mfp-title"></div>'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
'</div>',
},
callbacks: {
markupParse: function(template, values, item) {
values.title = '<h4>' + item.el.attr('title') + '</h4>' +
'<span class="date">'+item.el.find('.date').text()+'</span>';
},
},
closeMarkup: '<button title="Zamknij (Esc)" type="button" class="mfp-close"><i class="icon-close"></i></button>'
});
*/
});
})(jQuery);
</script>
</section>
<?php get_footer(); ?>