-
Notifications
You must be signed in to change notification settings - Fork 2
/
front-page.php
91 lines (65 loc) · 2.48 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
<?php
/**
* php This file is the template file for the homepage of foxtail
*/
get_header();
// get the current language
if ( function_exists('icl_object_id') ) {
$currentLang = apply_filters( 'wpml_current_language', NULL );
set_query_var('lang', $currentLang);
} else {
$currentLang = 'en';
set_query_var('lang', $currentLang);
}
global $_displayed_posts;
$_displayed_posts = array();
if (class_exists('ACF')) {
$featured_post = get_field('post_to_feature_en', 'option');
}
set_query_var('featured_post', $featured_post);
// if there is no ACF, then just show a basic loop
// for now, show all non-en pages the basic loop
if (!class_exists('ACF') || $currentLang != 'en') {
get_template_part('partials/basic-loop');
// otherwise show a custom static homepage thta is set by ACF
} else { ?>
<!-- This is the large featured post section -->
<?php get_template_part('partials/featured-post'); ?>
<div class="ft-l-space-unrelated"></div>
<!-- The 2nd featured section which has 3 items -->
<?php get_template_part('partials/featured-secondary'); ?>
<div class="ft-l-space-unrelated"></div>
<!-- The Featured Video section -->
<?php get_template_part('partials/featured-video'); ?>
<div class="ft-l-space-unrelated"></div>
<!-- Collection #1 -->
<?php get_template_part('partials/collection/collection-small-cards', null, array('collectionNum' => '1')); ?>
<div class="ft-l-space-unrelated"></div>
<!-- Collection #2 -->
<?php get_template_part('partials/collection/collection-large-cards', null, array('collectionNum' => '2')); ?>
<div class="ft-l-space-unrelated"></div>
<!-- Collection #3 -->
<?php get_template_part('partials/collection/collection-large-cards', null, array('collectionNum' => '3')); ?>
<div class="ft-l-space-unrelated"></div>
<!-- Collection #4 -->
<?php
$collection4 = get_field($currentLang . '_featured_collection_4', 'option');
if( $collection4['display'] ) {
get_template_part('partials/collection/collection-small-cards', null, array('collectionNum' => '4'));
echo '<div class="ft-l-space-unrelated"></div>';
}
?>
<!-- Collection #5 -->
<?php
$collection5 = get_field($currentLang . '_featured_collection_5', 'option');
if( $collection5['display'] ) {
get_template_part('partials/collection/collection-large-cards', null, array('collectionNum' => '5'));
echo '<div class="ft-l-space-unrelated"></div>';
}
?>
<!-- Featured CTA -->
<?php get_template_part('partials/featured-extra'); ?>
<!-- endif -->
<?php } ?>
<?php
get_footer();