-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpage-djs.php
74 lines (70 loc) · 2.9 KB
/
page-djs.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
<?php
/**
* Template Name: DJs
* The template for displaying ALL DJs in a list.
*/
get_header();
?>
<main id="main">
<div id="content" role="main">
<div class="container-fluid all-djs all-djs-wrapper" style="background-image: url('<?php the_post_thumbnail_url('full'); ?>');">
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1 class="all-djs-main-title">
<?php the_title(); ?>
</h1>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="broadcasters">
<div class="wrapper">
<?php
$djs = get_terms( array(
'taxonomy' => 'djs',
'hide_empty' => false,
'orderby' => 'name',
'order' => 'ASC',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'dont_show',
'value' => true,
'compare' => '!='
)
)
));
?>
<ul class="items">
<?php foreach ( $djs as $dj ) {
$dj_link = get_term_link($dj);
?>
<li class="item">
<a href="<?php echo esc_url($dj_link); ?>">
<?php
$dj_img_id = get_field('dj_photo', $dj);
$dj_img_small_id = get_field('dj_photo_small', $dj);
$dj_img_small = wp_get_attachment_image( $dj_img_small_id, 'dj_img', '', array( 'alt'=>$dj->name ) );
$dj_img = wp_get_attachment_image( $dj_img_id, 'dj_img', '', array( 'alt'=>$dj->name ) );
if( $dj_img_small_id )
echo $dj_img_small;
else
echo $dj_img;
?>
<span class="dj-name"><?php echo $dj->name; ?></span>
</a>
</li>
<?php } ?>
</ul><!--.items-->
</div><!--.wrapper-->
</div><!--.broadcasters-->
</div>
</div>
</div>
</div>
<?php get_sidebar(); ?>
</div>
</main>
</div>
<?php get_footer(); ?>