-
Notifications
You must be signed in to change notification settings - Fork 0
/
family.php
87 lines (58 loc) · 1.8 KB
/
family.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
<?php
/*
Template Name: Family Archive
*/
get_header();
?>
<main role="main" class="has-subheading">
<header class="subheading">
<div class="container">
<h1 class="h2"><?php the_field( 'headline' ); ?></h1>
<div class="backslash"></div>
<span><?php the_field( 'subheadline' ); ?></span>
</div>
</header>
<section class="family family--archive secondary-section">
<div class="container">
<?php
$args = array(
'post_type' => 'family',
'status' => 'show-on-family',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => -1
);
$query = new WP_Query( $args );
if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post();
$post_nom = get_field('post-noms');
if ( isset($post_nom ) && !empty( $post_nom ) ) $post_nom = ', <span class="post-nom">'.$post_nom.'</span>';
if( get_field('no-clickthru') ) { ?>
<div class="family--thumb">
<?php the_post_thumbnail( 'family-thumb' ); ?>
<div class="family--card"></div>
<div class="family--meta">
<span class="family--name"><?php the_title(); ?><?php echo $post_nom; ?></span>
<span class="family--desc"><?php the_field( 'position' ); ?></span>
</div>
</div>
<?php } else { ?>
<a href="<?php the_permalink(); ?>" class="family--thumb">
<?php the_post_thumbnail( 'family-thumb' ); ?>
<div class="family--card"></div>
<div class="family--meta">
<span class="family--name"><?php the_title(); ?><?php echo $post_nom; ?></span>
<span class="family--desc"><?php the_field( 'position' ); ?></span>
</div>
</a>
<?php } ?>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
</div>
</section>
</main>
<?php
get_footer();
?>