/
single.php
178 lines (96 loc) · 6.02 KB
/
single.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
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php get_header(); ?>
<div class="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'post-image' ); $url = $thumb['0']; ?>
<div class="featured-media">
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".featured-media").backstretch("<?php echo $url; ?>");
});
</script>
<?php the_post_thumbnail('post-image'); ?>
<?php if ( !empty(get_post(get_post_thumbnail_id())->post_excerpt) ) : ?>
<div class="media-caption-container">
<p class="media-caption"><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p>
</div>
<?php endif; ?>
</div> <!-- /featured-media -->
<?php endif; ?>
<div class="post-header section">
<div class="post-header-inner section-inner medium">
<?php if ( 'espresso_events' == get_post_type() && function_exists( 'espresso_event_date' ) ) : ?>
<p class="post-meta-top"><a href="<?php the_permalink(); ?>" title="<?php echo espresso_event_date( '', '', get_the_ID() ); ?>"><?php echo espresso_event_date( '', '', get_the_ID() ); ?></a> <?php if ( comments_open() ) { echo '<span class="sep">/</span> '; comments_popup_link( '0 comments', '1 comment', '% comments', 'post-comments' ); } ?> <?php edit_post_link( 'Edit', '<span class="sep">/</span> ' ); ?></p>
<?php elseif ( 'espresso_venues' == get_post_type() ) : ?>
<p class="post-meta-top"><a href="<?php the_permalink(); ?>" title="Telephone number"><?php espresso_venue_phone(); ?></a> <?php if ( comments_open() ) { echo '<span class="sep">/</span> '; comments_popup_link( '0 comments', '1 comment', '% comments', 'post-comments' ); } ?> <?php edit_post_link( 'Edit', '<span class="sep">/</span> ' ); ?></p>
<?php else : ?>
<p class="post-meta-top"><a href="<?php the_permalink(); ?>" title="<?php the_time('h:i'); ?>"><?php the_time(get_option('date_format')); ?></a> <?php if ( comments_open() ) { echo '<span class="sep">/</span> '; comments_popup_link( '0 comments', '1 comment', '% comments', 'post-comments' ); } ?> <?php edit_post_link( 'Edit', '<span class="sep">/</span> ' ); ?></p>
<?php endif; ?>
<h2 class="post-title"><?php the_title(); ?></h2>
</div> <!-- /post-header-inner section-inner -->
</div> <!-- /post-header section -->
<div class="post-content section-inner thin">
<?php the_content(); ?>
<div class="clear"></div>
<?php do_action('es_radcliffe_theme_after_content');?>
<?php wp_link_pages('before=<p class="page-links">' . __('Pages:','radcliffe') . ' &after=</p>&separator=<span class="sep">/</span>'); ?>
</div>
<div class="post-meta section-inner thin">
<div class="meta-block post-author">
<h3 class="meta-title"><?php _e('About the author','radcliffe'); ?></h3>
<div class="post-author-container">
<?php echo get_avatar( get_the_author_meta('email'), '160' ); ?>
<div class="post-author-inner">
<h3><?php the_author_posts_link(); ?></h3>
<p class="author-description"><?php the_author_meta('description'); ?></p>
<div class="author-links">
<a class="author-link-posts" title="<?php _e('Author archive','radcliffe'); ?>" href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php _e('Author archive','radcliffe'); ?></a>
<?php $author_url = get_the_author_meta('user_url');
$author_url = preg_replace('#^https?://#', '', rtrim($author_url,'/'));
if (!empty($author_url)) : ?>
<a class="author-link-website" title="<?php _e('Author website','radcliffe'); ?>" href="<?php the_author_meta('user_url'); ?>"><?php _e('Author website','radcliffe'); ?></a>
<?php endif; ?>
</div> <!-- /author-links -->
</div>
<div class="clear"></div>
</div>
</div> <!-- /post-author -->
<div class="meta-block post-cat-tags">
<h3 class="meta-title"><?php _e('About the post','radcliffe'); ?></h3>
<p class="post-categories">
<?php the_category(', '); ?>
</p>
<?php if ( has_tag() ) : ?>
<p class="post-tags">
<?php the_tags('', ', '); ?>
</p>
<?php endif; ?>
<div class="post-nav">
<?php
$next_post = get_next_post();
if (!empty( $next_post )): ?>
<p class="post-nav-next">
<a title="<?php _e('Next post:', 'radcliffe'); echo ' ' . get_the_title($next_post); ?>" href="<?php echo get_permalink( $next_post->ID ); ?>"><?php echo get_the_title($next_post); ?></a>
</p>
<?php endif; ?>
<?php
$prev_post = get_previous_post();
if (!empty( $prev_post )): ?>
<p class="post-nav-prev">
<a title="<?php _e('Previous post:', 'radcliffe'); echo ' ' . get_the_title($prev_post); ?>" href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php echo get_the_title($prev_post); ?></a>
</p>
<?php endif; ?>
<div class="clear"></div>
</div> <!-- /post-nav -->
</div> <!-- /post-cat-tags -->
<div class="clear"></div>
</div> <!-- /post-meta -->
</div> <!-- /post -->
<?php comments_template( '', true ); ?>
<?php endwhile; else: ?>
<p><?php _e("We couldn't find any posts that matched your query. Please try again.", "radcliffe"); ?></p>
<?php endif; ?>
</div> <!-- /post -->
</div> <!-- /content -->
<?php get_footer(); ?>