-
Notifications
You must be signed in to change notification settings - Fork 2
/
home.php
82 lines (63 loc) · 1.85 KB
/
home.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
<?php
/**
* Home template file.
*
* @package Kaingang
*/
get_header(); ?>
<?php
if ( get_theme_mod( 'kaingang_display_events' ) === true ) :
// Events arguments
$args = array(
'posts_per_page' => 4,
'post_type' => 'agenda',
'orderby' => 'meta_value',
'meta_key' => '_data_inicial',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => '_data_final',
'value' => date('Y-m-d'),
'compare' => '>=',
'type' => 'DATETIME'
)
)
);
$events = new WP_Query( $args );
if ( $events->have_posts() ) : ?>
<div class="events box clear">
<h3 class="page-title"><?php _e( 'Events', 'kaingang' ); ?></h3>
<div class="events-list">
<?php
while ( $events->have_posts() ) : $events->the_post();
kaingang_the_event();
endwhile;
wp_reset_postdata();
?>
</div>
</div>
<?php
endif;
endif; // get_theme_mod
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php kaingang_content_nav( 'nav-below' ); ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'index' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>