-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcta.php
99 lines (71 loc) · 2.73 KB
/
cta.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
<?php
/**
* CTA
*
* Template part used on the various templates/views
*
* @package F1 Growth10
* @author Factor1 Studios
* @since 1.3.1
*/
$bg = wp_get_attachment_image_src(get_sub_field('cta_background'), 'home_hero');
$headline = get_sub_field('cta_headline');
$desc = get_sub_field('card_description');
$monthlyPrice = get_sub_field('card_monthly_price');
$monthlyBtn = get_sub_field('card_monthly_button');
$monthlyBlurb = get_sub_field('card_monthly_blurb');
$annualPrice = get_sub_field('card_annual_price');
$annualBtn = get_sub_field('card_annual_button');
$annualBlurb = get_sub_field('card_annual_blurb');?>
<section class="cta" style="background: url('<?php echo $bg[0]; ?>') center/cover no-repeat">
<div class="container">
<div class="row row--justify-content-center row--align-items-center">
<div class="col-10 sm-col-12 text-center">
<h2><?php echo $headline; ?></h2>
<?php // if 2 prices
if( $monthlyBtn && $annualBtn ) : ?>
<div class="cta__toggle">
<span>Monthly</span>
<label class="switch">
<input type="checkbox">
<span class="slider"></span>
</label>
<span>Annual</span>
</div>
<?php endif; ?>
</div>
<div class="col-6">
<div class="cta__card">
<?php echo $desc; ?>
<?php // Monthly content ?>
<div class="cta__price monthly active text-center">
<h5>
<?php echo $monthlyPrice; ?>
<br>
<em><small><?php echo $monthlyBlurb; ?></small></em>
</h5>
</div>
<?php if( $annualBtn ) : ?>
<div class="cta__price annual text-center">
<h5>
<?php echo $annualPrice; ?>
<br>
<em><small><?php echo $annualBlurb; ?></small></em>
</h5>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-12 text-center">
<a href="<?php echo esc_url($monthlyBtn['url']); ?>" class="button button--teal button--monthly active" role="link" title="<?php echo $monthlyBtn['title']; ?>" target="<?php echo $monthlyBtn['target']; ?>">
<?php echo $monthlyBtn['title']; ?>
</a>
<?php if( $annualBtn ) : ?>
<a href="<?php echo esc_url($annualBtn['url']); ?>" class="button button--teal button--annual" role="link" title="<?php echo $annualBtn['title']; ?>" target="<?php echo $annualBtn['target']; ?>">
<?php echo $annualBtn['title']; ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
</section>