-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-agenda.php
90 lines (73 loc) · 3.1 KB
/
archive-agenda.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
<?php
/**
* TThe template for displaying the Agenda archive
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Flacso
*/
global $paged;
$showing_past = ( $paged > 0 || ( array_key_exists('eventos', $_GET ) && $_GET['eventos'] == 'passados' ) );
get_header(); ?>
<div class="col-md-9 col-md-push-3">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<header class="page-header">
<?php if ( $showing_past ) : ?>
<h1 class="page-title"><?php _e( 'Past events', 'flacso' ); ?></h1>
<a class="view-events" href="<?php echo get_post_type_archive_link( 'agenda' ); ?>"><?php _e( 'View upcoming events →', 'flacso' ); ?></a>
<?php else: ?>
<h1 class="page-title"><?php _e( 'Upcoming events', 'flacso' ); ?></h1>
<a class="view-events" href="<?php echo add_query_arg( 'eventos', 'passados' ); ?>"><?php _e( '← View past events', 'flacso' ); ?></a>
<?php endif; ?>
</header><!-- .page-header -->
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( $date_start = get_post_meta( $post->ID, '_data_inicial', true ) ) : ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'media' ); ?>>
<div class="entry-image pull-left">
<a href="<?php the_permalink(); ?>">
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail( 'thumbnail' ); ?>
<?php endif; ?>
</a>
</div><!-- .entry-image -->
<div class="media-body">
<header class="entry-header">
<div class="entry-meta">
<span aria-hidden="true" class="icon-calendar"></span>
<?php
$date_end = get_post_meta( $post->ID, '_data_final', true );
if ( $date_end && $date_end != $date_start ) :
/* translators: Initial & final date for the event */
printf(
__( '%1$s to %2$s', 'flacso' ),
date( 'd/m/y', strtotime( $date_start ) ),
date( 'd/m/y', strtotime( $date_end ) )
);
else :
echo date( 'd/m/y', strtotime( $date_start ) );
endif;
?>
</div><!-- .entry-meta -->
<?php the_title( sprintf( '<h1 class="entry-title media-heading"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
</header><!-- .entry-header -->
<div class="entry-content entry-content--summary">
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
</div><!-- .media-body -->
<a href="<?php the_permalink(); ?>" class="read-more pull-right"><?php _e( 'Read more', 'flacso' ); ?><span class="more-sign">+</span></a>
</article><!-- #post-## -->
<?php endif; ?>
<?php endwhile; ?>
<?php flacso_paging_nav(); ?>
<?php else : ?>
<div class="entry-content">
<?php _e( 'There is no events to display right now', 'flacso' ); ?>
</div>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- .col-md-# -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>