-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive-event-list.php
77 lines (73 loc) · 2.18 KB
/
archive-event-list.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
<?php
/*
Package: Kentha
Template Name: Archive events list
*/
get_header();
?>
<!-- ======================= MAIN SECTION ======================= -->
<div id="maincontent">
<div class="qt-main qt-clearfix qt-3dfx-content">
<?php get_template_part( 'phpincludes/part-background' ); ?>
<div id="qtarticle" class="qt-container qt-main-contents">
<div class="qt-pageheader-std <?php kentha_is_negative(); ?>">
<hr class="qt-spacer-m">
<h1 class="qt-caption"><?php get_template_part( 'phpincludes/part-archivetitle' ); ?></h1>
<hr class="qt-capseparator">
</div>
<div id="qtloop">
<?php
if(is_page()){
/**
* [$args Query arguments]
* @var array
*/
$args = array(
'post_type' => 'event',
'posts_per_page' => 6,
'post_status' => 'publish',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_key' => 'eventdate',
'suppress_filters' => false,
'paged' => kentha_get_paged()
);
/**
* For events we reorder by date and eventually hide past events
*/
if(get_theme_mod( 'kentha_events_hideold', 0 ) == '1'){
$args['meta_query'] = array(
array(
'key' => 'eventdate',
'value' => date('Y-m-d'),
'compare' => '>=',
'type' => 'date'
)
);
}
$wp_query = new WP_Query( $args );
if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();
$post = $wp_query->post;
setup_postdata( $post );
get_template_part ('phpincludes/part-event-inline');
endwhile; else: ?>
<h3><?php esc_html_e("Sorry, nothing here","kentha")?></h3>
<?php endif;
wp_reset_postdata();
} else {
if ( have_posts() ) : while ( have_posts() ) : the_post();
setup_postdata( $post );
get_template_part ( 'phpincludes/part-event-inline' );
endwhile; else: ?>
<h3><?php esc_html_e("Sorry, nothing here","kentha")?></h3>
<?php endif;
}
?>
<?php get_template_part ('phpincludes/part-pagination'); ?>
</div>
</div>
<hr class="qt-spacer-m">
</div>
</div>
<!-- ======================= MAIN SECTION END ======================= -->
<?php get_footer();