-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
124 lines (99 loc) · 3.11 KB
/
front-page.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
<?php
/*
Template Name: Home Page
*/
get_header();
$hero_img = get_field( 'home_hero_image' );
if( isset($hero_img) && !empty($hero_img) ) : ?>
<div class="hero cf">
<div class="hero--img cf" style="background-image: url(<?php echo wp_get_attachment_url( $hero_img ); ?>);"></div>
<div class="hero--overlay"></div>
<div class="hero--card"></div>
<?php
$hero_text = get_field( 'home_hero_text' );
$hero_cta = get_field( 'home_hero_cta' );
if( isset( $hero_text ) || isset( $hero_cta ) ) : ?>
<div class="container">
<div class="hero--img-text">
<?php echo ( !empty( $hero_text ) ? $hero_text : ''); ?>
</div>
<div class="hero--cta">
<?php echo ( !empty( $hero_cta ) ? $hero_cta : ''); ?>
</div>
</div>
<?php
endif;
?>
</div>
<?php
endif;
?>
<main role="main" class="has-hero">
<div class="container">
<?php
$top_left_title = get_field( 'card_title_tl' );
$top_left_text = get_field( 'card_text_tl' );
$top_left_img = get_field( 'card_image_tl' );
if( isset( $top_left_title ) && !empty( $top_left_title ) ) : ?>
<div class="card small">
<?php if( isset( $top_left_img ) && !empty( $top_left_img ) ) :
echo wp_get_attachment_image( $top_left_img, 'full', false, array( 'class' => 'card--img' ) );
endif; ?>
<div class="card--info text">
<?php if( isset( $top_left_title ) && !empty( $top_left_title ) ) : ?>
<h4 class="card--title"><?php echo $top_left_title; ?></h4>
<?php endif; ?>
<?php if( isset( $top_left_text ) && !empty( $top_left_text ) ) : ?>
<?php echo $top_left_text; ?>
<?php endif; ?>
</div>
</div>
<?php
endif;
?>
<?php
$top_right_title = get_field( 'card_title_tr' );
$top_right_text = get_field( 'card_text_tr' );
$top_right_img = get_field( 'card_image_tr' );
if( isset( $top_right_title ) && !empty( $top_right_title ) ) : ?>
<div class="card small">
<?php if( isset( $top_right_img ) && !empty( $top_right_img ) ) :
echo wp_get_attachment_image( $top_right_img, 'full', false, array( 'class' => 'card--img' ) );
endif; ?>
<div class="card--info text">
<?php if( isset( $top_right_title ) && !empty( $top_right_title ) ) : ?>
<h4 class="card--title"><?php echo $top_right_title; ?></h4>
<?php endif; ?>
<?php if( isset( $top_right_text ) && !empty( $top_right_text ) ) : ?>
<?php echo $top_right_text; ?>
<?php endif; ?>
</div>
</div>
<?php
endif;
?>
<?php
$large_title = get_field( 'card_title_lg' );
$large_text = get_field( 'card_text_lg' );
$large_img = get_field( 'card_image_lg' );
if( isset( $large_title ) && !empty( $large_title ) ) : ?>
<div class="card large">
<?php if( isset( $large_img ) && !empty( $large_img ) ) :
echo '<div class="sliced-img card--img">'.wp_get_attachment_image( $large_img, 'full', false, array() ).'</div>';
endif; ?>
<div class="card--info text">
<?php if( isset( $large_title ) && !empty( $large_title ) ) : ?>
<h4 class="card--title"><?php echo $large_title; ?></h4>
<?php endif; ?>
<?php if( isset( $large_text ) && !empty( $large_text ) ) : ?>
<?php echo $large_text; ?>
<?php endif; ?>
</div>
</div>
<?php
endif;
?>
</div>
</main>
<?php
get_footer();