-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
130 lines (88 loc) · 2.97 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
125
126
127
128
129
130
<?php
/**
* The template for displaying the "Home" page
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Taekwondo
*/
get_header();
?>
<main id="primary" class="site-main">
<?php if( function_exists('get_field')) { ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
// Variables
$hero = get_field( 'fp-hero' );
?>
<?php if ( $hero['video-switch'] ) { ?>
<section class="<?php echo $hero['class']; ?>">
<?php include( locate_template( 'components/frontpage/hero-video.php', false, false ) ); ?>
</section>
<?php } else { ?>
<section class="<?php echo $hero['class']; ?>">
<?php include( locate_template( 'components/frontpage/hero.php', false, false ) ); ?>
</section>
<?php } ?>
<?php endwhile; ?>
<!-- Frontpage "Training Groups" Section -->
<?php if( get_field( 'fp-groups-switch' ) ) { ?>
<section id="fp-groups" class="fp-section">
<?php
// Variables
$groups = get_field( 'fp-groups' );
?>
<?php include( locate_template( 'components/frontpage/training-groups.php', false, false ) ); ?>
</section> <!-- #fp-groups-section -->
<?php } ?>
<!-- Frontpage "Banner" Section -->
<?php if( get_field( 'fp-banner-switch' ) ) {
// variable
$bannerstyle = get_field( 'fp-banner' );
?>
<section class="fp-section <?php echo $bannerstyle['class']; ?>">
<?php
// Variables
$banner = get_field( 'fp-banner' );
$button_one_type = get_field( 'fp-banner' )['type-one'];
$button_two_type = get_field( 'fp-banner' )['type-two'];
$button_three_type = get_field( 'fp-banner' )['type-three'];
?>
<?php include( locate_template( 'components/frontpage/banner.php', false, false ) ); ?>
</section>
<?php } ?>
<!-- Frontpage "News Reel" Section -->
<?php if( get_field( 'fp-news-switch' ) ) { ?>
<section id="fp-newsfeed" class="fp-section">
<div class="wrap-full-width">
<?php
// Variables
$number = get_field( 'fp-news-number' );
$args = array(
'posts_per_page' => $number,
'orderby' => 'DESC',
'post_status' => 'publish',
'perm' => 'readable'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
include( locate_template( 'components/frontpage/newsfeed.php', false, false ) );
endwhile;
wp_reset_postdata();
?>
<div class="fp-newsfeed-link">
<button type="button" id="newsfeed-link" onclick="window.open('<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>', '_self')"><i class="fas fa-chevron-circle-right"></i> News Page</button>
</div>
</div>
</section>
<?php } ?>
<?php } else { ?>
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'page' );
endwhile; // End of the loop.
?>
<?php } ?>
</main><!-- #main -->
<?php
get_footer();