-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-event.php
132 lines (109 loc) · 4.45 KB
/
archive-event.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
<?php
/**
*
* Queries to do with events will default to this template if a more appropriate template cannot be found
*
***************** NOTICE: *****************
* Do not make changes to this file. Any changes made to this file
* will be overwritten if the plug-in is updated.
*
* To overwrite this template with your own, make a copy of it (with the same name)
* in your theme directory.
*
* WordPress will automatically prioritise the template in your theme directory.
***************** NOTICE: *****************
*
* @package Event Organiser (plug-in)
* @since 1.0.0
*/
//Call the template header
get_header(); ?>
<!-- This template follows the TwentyTwelve theme-->
<div id="primary" class="site-content">
<div id="content" role="main">
<!-- Page header-->
<header class="page-header">
<h1 class="page-title">
<?php
if( eo_is_event_archive('day') )
//Viewing date archive
echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('jS F Y');
elseif( eo_is_event_archive('month') )
//Viewing month archive
echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('F Y');
elseif( eo_is_event_archive('year') )
//Viewing year archive
echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('Y');
else
_e('Events','eventorganiser');
?>
</h1>
</header>
<?php if ( have_posts() ) : ?>
<!-- Navigate between pages-->
<!-- In TwentyEleven theme this is done by twentyeleven_content_nav-->
<?php
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="nav-above">
<div class="nav-next events-nav-newer"><?php next_posts_link( __( 'Later events <span class="meta-nav">→</span>' , 'eventorganiser' ) ); ?></div>
<div class="nav-previous events-nav-newer"><?php previous_posts_link( __( ' <span class="meta-nav">←</span> Newer events', 'eventorganiser' ) ); ?></div>
</nav><!-- #nav-above -->
<?php endif; ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title" style="display: inline;">
<?php
//If it has one, display the thumbnail
the_post_thumbnail('thumbnail', array('style'=>'float:left;margin-right:20px;'));
?>
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
</h1>
<div class="event-entry-meta">
<!-- Output the date of the occurrence-->
<?php
//Format date/time according to whether its an all day event.
//Use microdata http://support.google.com/webmasters/bin/answer.py?hl=en&answer=176035
if( eo_is_all_day() ){
$format = 'd F Y';
$microformat = 'Y-m-d';
}else{
$format = 'd F Y <\s\p\a\n \c\l\a\s\s="\t-\i">g:ia</\s\p\a\n>';
$microformat = 'c';
}?>
<time itemprop="startDate" datetime="<?php eo_the_start($microformat); ?>"><?php eo_the_start($format); ?></time>
<!-- Display event meta list -->
<?php echo eo_get_event_meta_list(); ?>
<!-- Show Event text as 'the_excerpt' or 'the_content' -->
<?php the_excerpt(); ?>
</div><!-- .event-entry-meta -->
<div style="clear:both;"></div>
</header><!-- .entry-header -->
</article><!-- #post-<?php the_ID(); ?> -->
<?php endwhile; ?><!--The Loop ends-->
<!-- Navigate between pages-->
<?php
if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="nav-below">
<div class="nav-next events-nav-newer"><?php next_posts_link( __( 'Later events <span class="meta-nav">→</span>' , 'eventorganiser' ) ); ?></div>
<div class="nav-previous events-nav-newer"><?php previous_posts_link( __( ' <span class="meta-nav">←</span> Newer events', 'eventorganiser' ) ); ?></div>
</nav><!-- #nav-below -->
<?php endif; ?>
<?php else : ?>
<!-- If there are no events -->
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'eventorganiser' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive', 'eventorganiser' ); ?></p>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</div><!-- #primary -->
<!-- Call template sidebar and footer -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>