-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlinktree.php
123 lines (103 loc) · 4.5 KB
/
linktree.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
<?php
/**
* Template Name: Custom - Linktree
*
* This page generates a "Linktree" style page so we can keep all of our page views in house.
*
* Usage: Create a new page, select "Custom - Linktree" in the template and then build it out.
*
* @package WordPress
* @subpackage Bootcamp_2
* @author Josh Forrester <[email protected]>
* @version 1.0.0
*/
get_header(); ?>
<?php
// Get the logo from acf or fall back to default logo if left blank / null
$logo = get_field( 'logo' ) ?: get_template_directory_uri() . '/assets/src/img/circle-brand.png';
// Get the title from acf or fall back to default title if left blank / null
$title = get_field( 'title' ) ?: 'Foothills Church';
// Get the subtitle from acf or fall back to default subtitle if left blank / null
$subtitle = get_field( 'subtitle' ) ?: 'You Belong here ❤️';
?>
<div class="bg-blue-gradient relative">
<div class="bg-no-repeat bg-scroll bg-cover relative pb-20"
style="background:
url('<?php echo get_template_directory_uri(); ?>/assets/src/img/topography-salty.png') center center; ">
<div class="lg:max-w-5xl mx-auto grid grid-cols-12 p-5 pt-10 gap-4">
<div class="col-span-12 mx-auto w-32">
<img src="<?php echo $logo ?>"
alt="FC Logo">
</div>
<div class="col-span-12 mx-auto text-center">
<h1 class="text-3xl font-bold"><?php echo $title ?></h1>
<h3 class="text-md uppercase"><?php echo $subtitle ?></h3>
<?php if ( get_field( 'socials' ) !== 'no' ): ?>
<div class="pt-2">
<a href="<?php the_field( 'facebook', 'options' ); ?>" target="_blank">
<i class="text-2xl pr-1 fa-brands fa-facebook"></i>
</a>
<a href="<?php the_field( 'instagram', 'options' ); ?>" target="_blank">
<i class="text-2xl pr-1 fa-brands fa-instagram"></i>
</a>
<a href="<?php the_field( 'twitter', 'options' ); ?>" target="_blank">
<i class="text-2xl pr-1 fa-brands fa-x"></i>
</a>
<a href="<?php the_field( 'youtube', 'options' ); ?>" target="_blank">
<i class="text-2xl pr-1 fa-brands fa-youtube"></i>
</a>
<a href="<?php the_field( 'spotify', 'options' ); ?>" target="_blank">
<i class="text-2xl pr-1 fa-brands fa-spotify"></i>
</a>
</div>
<?php endif; ?>
</div>
</div>
<?php
if ( have_rows( 'link_group' ) ):
while ( have_rows( 'link_group' ) ) :
the_row();
?>
<div class="lg:max-w-3xl mx-auto grid grid-cols-12 p-5 mt-2">
<div class="col-span-12 text-center">
<h3 class="text-xl font-bold"><?php the_sub_field( 'section_title' ); ?></h3>
</div>
<?php
if ( have_rows( 'link' ) ) :
while ( have_rows( 'link' ) ) : the_row();
// Check if the button should be hidden
if ( get_sub_field( 'hide_button' ) == 'yes' ) {
continue;
}
// Handle non-prioritized buttons
if ( get_sub_field( 'prioritize' ) == 'no' ) { ?>
<div class="col-span-12">
<?php
$args = [
'button_field' => 'button_link',
'sub_field' => true,
'button_class' => 'elevated-white-lt mt-3 relative block w-full button-link',
'button_icon_field' => 'icon', // Icon field from ACF
'long_button' => true
];
get_template_part( 'components/partials/button-template', null, $args );
?>
</div>
<?php }
// Handle prioritized buttons
if ( get_sub_field( 'prioritize' ) == 'yes' ) { ?>
<div class="col-span-12 relative mt-5">
<?php get_template_part( 'components/partials/image-button' ); ?>
</div>
<?php }
endwhile;
endif;
?>
</div>
<?php
endwhile;
endif;
?>
</div>
</div>
<?php get_footer();