G

team member facet new template

public
Guest May 15, 2024 Never 16
Clone
Plaintext paste1.txt 54 lines (50 loc) | 1.64 KB
1
<?php
2
$title = get_sub_field('title');
3
$subtitle = get_sub_field('subtitle');
4
5
$args = array(
6
'post_type' => array( 'team_member' ),
7
'post_status' => array( 'publish' ),
8
'posts_per_page' => 4,
9
'orderby' => 'menu_order',
10
'order' => 'ASC',
11
'facetwp' => true,
12
);
13
//TODO: Proper background headshots, and full photos to accompany
14
$query = new WP_Query( $args );
15
?>
16
17
<div class="content-row team-members">
18
<?php if($title || $subtitle):?>
19
<div class="titles content-bounds text-center mb-5">
20
<?php if($title):?><div class="title">
21
<h3 class="title"><?php echo $title;?></h3>
22
</div><?php endif;?>
23
<?php if($subtitle): ?><p class="copy"><?php echo $subtitle;?></p><?php endif;?>
24
</div>
25
<?php endif;?>
26
27
<div class="filters content-bounds">
28
<div class="filters-inner">
29
<div class="filter categories"><?php echo do_shortcode('[facetwp facet="cats"]');?></div>
30
</div>
31
</div>
32
<div class="facetwp-template">
33
<?php if($query->have_posts()):
34
$count = $query->found_posts;?>
35
<div class="team-members-container content-bounds">
36
<div class="results-container" data-n="<?php echo $count;?>">
37
<?php while ( $query->have_posts() ) :
38
$query->the_post();
39
get_template_part('components/content-rows/team_member');
40
endwhile;?>
41
</div>
42
</div>
43
<?php else :?>
44
<p class="text-center p-2">Sorry, no post matched your criteria</p>
45
<?php
46
endif;
47
wp_reset_postdata();
48
?>
49
</div>
50
<div class="pagination content-bounds">
51
<?php echo do_shortcode('[facetwp facet="pagination"]');?>
52
</div>
53
54
</div>