-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.php
More file actions
67 lines (59 loc) · 2.55 KB
/
page.php
File metadata and controls
67 lines (59 loc) · 2.55 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
66
67
<?php
/*
Template Name: Page
*/
get_header(); ?>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<?php if ( wp_is_mobile() ) {
$img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large', false, '' ); } else {
$img = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false, '' ); } ?>
<div class="hero">
<div class="full-container h-full">
<?php $hero_bg = get_field('hero_background'); ?>
<?php if ( $hero_bg == 'image' ) : ?>
<?php if ( has_post_thumbnail() ) : ?>
<div class="absolute inset-0">
<img class="h-full w-full object-cover" src="<?php echo $img[0]; ?>" alt="">
<div class="absolute inset-0 bg-black/30"></div>
</div>
<?php endif; ?>
<?php elseif ( $hero_bg == 'video' ) : ?>
<?php $video_files = get_field('video_files'); ?>
<?php if ( $video_files ) : ?>
<?php $mp4 = $video_files['mp4']; ?>
<?php $webm = $video_files['webm']; ?>
<?php $ogv = $video_files['ogv']; ?>
<?php if ( $mp4 || $webm || $ogv ) : ?>
<video class="absolute inset-0 w-full h-full object-cover" autoplay loop muted playsinline>
<?php if ( $mp4 ) : ?><source src="<?php echo $mp4; ?>" type="video/mp4"><?php endif; ?>
<?php if ( $webm ) : ?><source src="<?php echo $webm; ?>" type="video/webm"><?php endif; ?>
<?php if ( $ogv ) : ?><source src="<?php echo $ogv; ?>" type="video/ogg"><?php endif; ?>
</video>
<div class="absolute inset-0 bg-black/10 bg-gradient-to-b from-black/60 to-transparent"></div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<div class="site-container hero-md">
<article class="lead text-white max-w-3xl">
<?php the_content(); ?>
<?php $link = get_field('link');
if( $link ):
$link_url = $link['url'];
$link_title = $link['title'];
$link_target = $link['target'] ? $link['target'] : '_self';
?>
<a class="btn btn-dark"
href="<?php echo esc_url($link_url); ?>"
target="<?php echo esc_attr( $link_target ); ?>" >
<?php echo esc_html($link_title); ?>
</a>
<?php endif; ?>
</article>
</div>
</div>
</div>
<div class="modules container mx-auto">
<?php get_template_part( 'page', 'modules' ); ?>
</div>
<?php endwhile; endif; ?>
<?php get_footer(); ?>