-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevents-page.php
63 lines (37 loc) · 1.02 KB
/
events-page.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
<?php
/*
Template Name: Events
*/
$featured_event = get_field('featured_event');
$featured_id = $featured_event->ID;
?>
<?php get_header(); ?>
<main>
<nav class="breadcrumb">
<?php bcn_display(); ?>
</nav>
<div class="main">
<?php get_sidebar('page'); ?>
<article>
<h1 class="page-title">Upcoming Events</h1>
<?php // featured event
if( $featured_event ) {
$post = $featured_event;
setup_postdata( $post );
include('partials/article.php');
wp_reset_postdata();
}
?>
<?php // loop through the rest of the events
$loop = new WP_Query( array('post_type' => 'events', 'posts_per_page' => -1, 'post__not_in' => array($featured_id) ) );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) {
$loop->the_post();
get_template_part('partials/article');
}
}
?>
</article>
</div> <!-- end .main -->
</main>
<?php get_footer(); ?>