-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
165 lines (153 loc) · 8.41 KB
/
index.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?php get_header(); ?>
<?php
$args = array(
'post_type' => 'events',
'posts_per_page' => 3,
'meta_key' => 'event_timestamp_date',
'orderby' => 'meta_value',
'order' => 'ASC'
);
$events = new WP_Query( $args );
$nextEvents = 0;
?>
<?php if( $events->have_posts() && $nextEvents > 0 ): ?>
<section class="section container">
<h2 class="section__title"><i class="icon icon-calendar" aria-hidden="true"></i> Próximos Eventos</h2>
<div class="card">
<div class="row">
<?php while ( $events->have_posts() ) : $events->the_post(); ?>
<?php
$date = get_post_meta( $post->ID, 'event_date', true );
$hour = get_post_meta( $post->ID, 'event_hours', true );
$location = get_post_meta( $post->ID, 'event_location', true );
// $description = get_post_meta( $post->ID, 'event_description', true );
$timestamp_date = get_post_meta( $post->ID, 'event_timestamp_date', true );
$timestamp_now = strtotime(date('Y-m-d'));
// $isRealized = ($timestamp_now >= $timestamp_date) ? true : false;
if($timestamp_date >= $timestamp_now):
$nextEvents++;
?>
<article class="col-md-4">
<div class="article">
<header class="article__heading">
<h2 class="article__title">
<a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_title() ?></a>
</h2>
<div class="article__meta">
<span><?php if($date) {
echo "<i class='icon icon-calendar'></i> " . date("d/m/Y", strtotime($date));
} ?></span>
<span><?php if($date && $hour) { echo '|'; } ?></span>
<span><?php if($hour) {
echo "<i class='icon icon-clock-o'></i> " . $hour;
} ?></span>
<span><?php if($location) { echo '|'; } ?></span>
<span><?php if($location) {
echo "<a href='http://maps.google.com/?q={$location}' target='_blank'><i class='icon icon-map-marker'></i> {$location}</a>";
} ?></span>
</div>
</header>
<?php /*
<div class="article__content">
<p>
<a href="<?php the_permalink() ?>" title="<?php the_title() ?>">
<?php echo odin_excerpt( 'excerpt', 10 ) ?> [Continue lendo]
</a>
</p>
</div>
*/ ?>
</div>
</article>
<?php endif; ?>
<?php endwhile; ?>
</div>
<a href="<?php echo esc_url( home_url( '/events' ) ); ?>" class="card__view-all">Ver todos</a>
</div>
</section>
<?php endif ?>
<?php $query = new WP_Query( 'posts_per_page=4' ); ?>
<?php if ( $query->have_posts() ): ?>
<section class="section container">
<h2 class="section__title"><i class="icon icon-file-text" aria-hidden="true"></i> Artigos da comunidade</h2>
<div class="card">
<div class="row">
<?php while ( $query->have_posts() ): $query->the_post(); ?>
<article class="col-md-3">
<div class="article">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="article__thumb">
<?php
$postTitle = get_the_title();
$thumbnail = odin_thumbnail( '250', '190', "Imagem do artigo: $postTitle", true, '', true);
if ($thumbnail):
?>
<figure>
<?php echo $thumbnail ?>
</figure>
<?php endif; ?>
</a>
<header class="article__heading">
<h2 class="article__title">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h2>
<div class="article__meta">
<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) ) : ?>
<span class="cat-links"><?php echo __( 'Posted in:', 'odin' ) . ' ' . get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'odin' ) ); ?></span>
<?php endif; ?>
<?php the_tags( '<span class="tag-links">' . __( 'Tagged as:', 'odin' ) . ' ', ', ', '</span>' ); ?>
<?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'odin' ), __( '1 Comment', 'odin' ), __( '% Comments', 'odin' ) ); ?></span>
<?php endif; ?>
</div>
</header>
<!--<div class="article__content">
<p>Nisi dolor ad culpa amet fugiat culpa. Excepteur pariatur sunt aute elit in aute lorem...
<a href="#">[Continue lendo]</a></p>
</div>-->
</div>
</article>
<?php endwhile; ?>
</div>
<!-- <a href="#" class="card__view-all">Ver todos</a> -->
</div>
</section>
<?php endif; ?>
<section class="section container">
<div class="row">
<div class="col-md-6">
<h2 class="section__title"><i class="icon icon-bell" aria-hidden="true"></i> Avisos</h2>
<div class="card">
<div class="card--notifications">
<?php
$args = array( 'post_type' => 'notifications', 'posts_per_page' => 6 );
$loop = new WP_Query( $args );
?>
<?php if( $loop->have_posts() ): ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<article class="article article--notifications">
<header class="article__heading">
<h2 class="article__title">
<a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_title() ?></a>
</h2>
</header>
<p><a href="<?php the_permalink() ?>"><?php echo odin_excerpt( 'excerpt', 10 ) ?> [Continue lendo]</a></p>
</article>
<?php endwhile; ?>
<?php else: ?>
<p>Nenhum aviso por aqui... </p>
<?php endif ?>
</div>
</div>
<h2 class="section__title">
<a href="https://github.com/phppr/vagas" target="_blank"><i class="icon icon-briefcase" aria-hidden="true"></i> Vagas no Paraná</a>
</h2>
<div class="card">
<ul id="phpprJobs" class="jobs"></ul>
</div>
</div>
<div class="col-md-6">
<?php get_template_part( 'inc/twitter-iframe' ) ?>
</div>
</div>
</section>
<?php get_template_part( 'inc/section-members' ) ?>
<?php get_footer(); ?>