-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
165 lines (87 loc) · 4.83 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
<?php get_header(); ?>
<div class="wrapper section-inner">
<?php require('ad-top.php'); ?>
<div class="content left">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="posts">
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post-header">
<?php if ( has_post_thumbnail() ) : ?>
<div class="featured-media">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<?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; ?>
</a>
</div> <!-- /featured-media -->
<?php endif; ?>
<?php $videourl = get_post_meta($post->ID, 'videourl', true); if ( $videourl != '' ) : ?>
<div class="featured-media">
<?php if (strpos($videourl,'.mp4') !== false) : ?>
<video controls>
<source src="<?php echo $videourl; ?>" type="video/mp4">
</video>
<?php else : ?>
<?php
$embed_code = wp_oembed_get($videourl);
echo $embed_code;
?>
<?php endif; ?>
</div> <!-- /featured-media -->
<?php endif; ?>
<h2 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="post-meta">
<span class="post-date"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_time(get_option('date_format')); ?></a></span>
<span class="date-sep"> / </span>
<span class="post-author"><?php the_author_posts_link(); ?></span>
<span class="date-sep"> / </span>
<?php comments_popup_link( '<span class="comment">' . __( '0 Comments', 'hemingway' ) . '</span>', __( '1 Comment', 'hemingway' ), __( '% Comments', 'hemingway' ) ); ?>
<?php if ( current_user_can( 'manage_options' ) ) { ?>
<span class="date-sep"> / </span>
<?php edit_post_link(__('Edit', 'hemingway')); ?>
<?php } ?>
</div>
</div> <!-- /post-header -->
<div class="post-content">
<?php the_content(); ?>
<?php wp_link_pages(); ?>
</div> <!-- /post-content -->
<div class="clear"></div>
<div class="post-meta-bottom">
<p class="post-categories"><span class="category-icon"><span class="front-flap"></span></span> <?php the_category(', '); ?></p>
<?php if( has_tag()) { ?><p class="post-tags"><?php the_tags('', ''); ?></p><?php } ?>
<div class="clear"></div>
<div class="post-nav">
<?php
$prev_post = get_previous_post();
if (!empty( $prev_post )): ?>
<a class="post-nav-older" title="<?php _e('Anterior:', 'hemingway'); echo ' ' . get_the_title($prev_post); ?>" href="<?php echo get_permalink( $prev_post->ID ); ?>">
<h5><?php _e('Anterior', 'hemingway'); ?></h5>
<?php echo get_the_title($prev_post); ?>
</a>
<?php endif; ?>
<?php
$next_post = get_next_post();
if (!empty( $next_post )): ?>
<a class="post-nav-newer" title="<?php _e('Seguinte:', 'hemingway'); echo ' ' . get_the_title($next_post); ?>" href="<?php echo get_permalink( $next_post->ID ); ?>">
<h5><?php _e('Seguinte', 'hemingway'); ?></h5>
<?php echo get_the_title($next_post); ?>
</a>
<?php endif; ?>
<div class="clear"></div>
</div> <!-- /post-nav -->
</div> <!-- /post-meta-bottom -->
<?php comments_template( '', true ); ?>
<?php endwhile; else: ?>
<p><?php _e("We couldn't find any posts that matched your query. Please try again.", "hemingway"); ?></p>
<?php endif; ?>
</div> <!-- /post -->
</div> <!-- /posts -->
</div> <!-- /content -->
<?php get_sidebar(); ?>
<div class="clear"></div>
</div> <!-- /wrapper -->
<?php get_footer(); ?>