-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-el_events.php
59 lines (56 loc) · 1.58 KB
/
archive-el_events.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
<?php
/**
*
* @link https://developer.wordpress.org/themes/template-files-section/page-template-files/
*
* @package coletivo
*/
get_header(); ?>
<div id="content" class="container">
<?php $current_date = date('Y-m-d');?>
<?php $query = new WP_Query(
array(
'post_type' => 'el_events',
'posts_per_page' => -1,
'orderby' => 'meta_value',
'meta_key' => 'startdate',
'meta_compare' => '>=',
'meta_value' => $current_date,
'order' => 'ASC'
)
);
?>
<?php if ( $query->have_posts() ) : ?>
<h1 class="the-title">
<?php _e( 'Agenda - Próximos eventos', 'csem-theme' );?>
</h1><!-- .the-title -->
<div class="col-md-12 agenda-container">
<?php while( $query->have_posts() ) : $query->the_post(); ?>
<?php get_template_part( 'section-parts/each-agenda' ); ?>
<?php endwhile;?>
</div><!-- .col-md-12 agenda-container -->
<?php endif;?>
<?php $query = new WP_Query(
array(
'post_type' => 'el_events',
'posts_per_page' => -1,
'orderby' => 'meta_value',
'meta_key' => 'startdate',
'meta_compare' => '<',
'meta_value' => $current_date,
'order' => 'ASC'
)
);
?>
<?php if ( $query->have_posts() ) : ?>
<h1 class="the-title">
<?php _e( 'Agenda - Eventos Anteriores', 'csem-theme' );?>
</h1><!-- .the-title -->
<div class="col-md-12 agenda-container">
<?php while( $query->have_posts() ) : $query->the_post(); ?>
<?php get_template_part( 'section-parts/each-agenda' ); ?>
<?php endwhile;?>
</div><!-- .col-md-12 agenda-container -->
<?php endif;?>
</div><!-- #content -->
<?php get_footer();