-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontent-video.php
More file actions
65 lines (35 loc) · 1.57 KB
/
content-video.php
File metadata and controls
65 lines (35 loc) · 1.57 KB
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
<div class="post-header">
<h2 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<?php if( is_sticky() ) { ?> <span class="sticky-post"><?php _e('Sticky post', 'baskerville'); ?></span> <?php } ?>
</div> <!-- /post-header -->
<?php $video_url = get_post_meta($post->ID, 'video_url', true); if ( $video_url != '' ) : ?>
<div class="featured-media">
<?php if (strpos($video_url,'.mp4') !== false) : ?>
<video controls>
<source src="<?php echo $video_url; ?>" type="video/mp4">
</video>
<?php else : ?>
<?php
$embed_code = wp_oembed_get($video_url);
echo $embed_code;
?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if($post->post_content != "") : ?>
<div class="post-excerpt">
<?php the_excerpt('100'); ?>
</div> <!-- /post-excerpt -->
<?php endif; ?>
<div class="post-meta">
<a class="post-date" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_time( 'Y/m/d' ); ?></a>
<?php
if( function_exists('zilla_likes') ) zilla_likes();
if ( comments_open() ) {
comments_popup_link( '0', '1', '%', 'post-comments' );
}
edit_post_link();
?>
<div class="clear"></div>
</div>
<div class="clear"></div>