-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcontent-video.php
76 lines (43 loc) · 1.64 KB
/
content-video.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
<div class="post-container">
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php $media_url = get_post_meta($post->ID, 'media_url', 1);?>
<?php if ( isset ( $media_url ) ) : ?>
<div class="featured-media">
<?php
// can we embed this audio url?
if ( is_url_embeddable( $media_url ) ) {
// Use oEmbed for YouTube, et al
$embed_code = wp_oembed_get( $media_url );
echo $embed_code;
} else {
// then we have a video file so show it as a player
echo splotbox_get_videoplayer( $media_url );
}
?>
</div><!-- .featured-media -->
<?php endif; ?>
<?php if ( is_sticky() ) : ?>
<div class="is-sticky">
<div class="genericon genericon-pinned"></div>
</div>
<?php endif; ?>
<div class="post-inner">
<?php if ( get_the_title() ) : ?>
<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>
</div><!-- .post-header -->
<?php endif;
// if stuff has a more tag..
if ( $pos = strpos( $post->post_content, '<!--more-->' ) ) {
// Fetch post content
$content = get_post_field( 'post_content', get_the_ID() );
// Get content parts
$content_parts = get_extended( $content );
echo '<p class="post-excerpt">' . wp_strip_all_tags( mb_strimwidth( $content_parts['extended'], 0, 200, '...' ), true ) . '</p>';
} else {
the_excerpt();
}
garfunkel_meta(); ?>
</div><!-- .post-inner -->
</div>
</div>