-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-landing.php
executable file
·83 lines (70 loc) · 2.5 KB
/
template-landing.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
<?php
/*
Template Name: Landing
*/
get_header(); ?>
<section id="content" role="main">
<div class="banner">
<div class="container">
<div class="text">
<p><?php the_field('banner_description'); ?></p>
</div>
<div class="buttons">
<a class="button primary" href="<?php the_field('banner_primary_button_url'); ?>">
<?php the_field('banner_primary_button_text'); ?>
</a>
<?php if (get_field('banner_secondary_button_text') && get_field('banner_secondary_button_url')) { ?>
<a class="button secondary" href="<?php the_field('banner_secondary_button_url'); ?>">
<?php the_field('banner_secondary_button_text'); ?>
</a>
<?php } ?>
</div>
<div class="clearfix"></div>
</div> <!-- .container -->
</div> <!-- .banner -->
<?php
// check if the flexible content field has rows of data
if( have_rows('flexible_content') ):
// loop through the rows of data
while ( have_rows('flexible_content') ) : the_row();
if( get_row_layout() == 'standard_text_block' ): ?>
<div class="standard-text-block">
<h2><?php the_sub_field('headline'); ?></h2>
<?php if (get_sub_field('image')) {
$image = get_sub_field('image'); ?>
<img class="image" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php } ?>
<div class="text">
<?php the_sub_field('text_content'); ?>
</div>
<div class="clearfix"></div>
</div> <!-- .standard-text-block -->
<?php
elseif( get_row_layout() == 'blue_callout_block' ): ?>
<div class="blue-callout-block">
<div class="description">
<h2><?php the_sub_field('headline'); ?></h2>
<div class="text">
<?php the_sub_field('text_content'); ?>
</div>
<a class="button tertiary" href="<?php the_sub_field('action_button_url'); ?>">
<?php the_sub_field('action_button_text'); ?>
</a>
</div>
<?php if (get_sub_field('image')) {
$image = get_sub_field('image'); ?>
<img class="image" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php } ?>
<div class="clearfix"></div>
</div> <!-- .blue-callout-block -->
<?php
endif;
endwhile;
else :
// no layouts found! oh the humanity!
// not showing nothin'
endif;
?>
<div class="clearfix"></div>
</section>
<?php get_footer(); ?>