This repository was archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcontent-page-hero.php
More file actions
56 lines (39 loc) · 1.89 KB
/
content-page-hero.php
File metadata and controls
56 lines (39 loc) · 1.89 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
<?php
//PAGE META
$post_subtitle = get_post_meta($post->ID, '_bean_post_subtitle', true);
$post_cover_color = get_post_meta($post->ID, '_bean_post_cover_color', true);
$video_background_upload = get_post_meta($post->ID, '_bean_video_background_upload', true);
$embedded_background_upload = get_post_meta($post->ID, '_bean_embedded_background_upload', true);
// USE FEATURED IMAGE OR BACKGROUND COLOR FOR LINK AND QUOTE
$feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
if ( $feat_image == true ) {
$style = 'background-image: url(' . $feat_image . ');';
} else {
$style = 'background-color: '.$post_cover_color.'';
} ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('row post-grid head fadein'); ?>>
<?php if( $video_background_upload ) { ?>
<video class="background-video" autoplay="" loop="" muted="">
<source src="<?php echo esc_html( $video_background_upload ); ?>" type="video/mp4">
</video>
<?php } elseif ($embedded_background_upload) { ?>
<div class="background-video embedded">
<?php echo stripslashes(htmlspecialchars_decode($embedded_background_upload)); ?>
</div>
<?php } else { } ?>
<div class="post-cover post-cover-<?php the_ID(); ?>" style="<?php echo esc_html( $style ); ?>"></div>
<div class="post-cover-link" data-0="opacity:.4;" data-50="opacity:.75;" style="background-color: <?php echo esc_html( $post_cover_color ); ?>;"></div>
<div class="post-content">
<header class="entry-header">
<h1 class="entry-title">
<?php the_title(); ?>
</h1><!-- END .entry-title -->
</header><!-- END .entry-header -->
<?php if ( $post_subtitle ) { ?>
<div class="entry-excerpt">
<h5><?php echo esc_html( $post_subtitle ); ?></h5>
</div><!-- END .entry-excerpt -->
<?php } ?>
</div><!-- END .post-content -->
<div class="down-arrow" data-0="opacity:1;" data-50="opacity:0;"></div>
</article><!-- END #post-<?php the_ID(); ?> -->