-
Notifications
You must be signed in to change notification settings - Fork 2
/
template-home.php
93 lines (91 loc) · 2.77 KB
/
template-home.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
<?php
/**
* Template Name: Home Page
*
* The template for displaying the theme's static home page.
*
* @package Canuck CP ClassicPress Theme
* @copyright Copyright (C) 2020 or later Kevin Archibald
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @author Kevin Archibald <https://kevinsspace.ca/contact/>
*/
global $canuckcp_exclude_page_title,$canuckcp_include_breadcrumbs, $canuckcp_feature_category;
$canuckcp_home_feature = get_theme_mod( 'canuckcp_home_feature', 'no_feature' );
$canuckcp_feature_category = sanitize_text_field( get_theme_mod( 'canuckcp_home_feature_category', '' ) );
get_header( 'home' );
if ( 'button_nav' === $canuckcp_home_feature ) {
?>
<div id="feature-slider-wide">
<div id="feature-slider-wrap">
<?php
if ( '' === $canuckcp_feature_category ) {
?>
<span class="error"><?php esc_html_e( 'You need to select a category in the "Canuck Home Page => Home Feature Options" panel!', 'canuck-cp' ); ?></span>
<?php
} else {
get_template_part( '/template-parts/feature-slider-parts/slider', 'button-nav-3to1' );
}
?>
</div>
</div>
<?php
} elseif ( 'fullsize' === $canuckcp_home_feature ) {
?>
<div id="feature-slider-wide">
<div id="feature-slider-wrap">
<?php
if ( '' === $canuckcp_feature_category ) {
?>
<span class="error"><?php esc_html_e( 'You need to select a category in the \"Canuck Home Page => Home Feature Options\" panel!', 'canuck-cp' ); ?></span>
<?php
} else {
get_template_part( '/template-parts/feature-slider-parts/slider', 'button-nav-fullsize' );
}
?>
</div>
</div>
<?php
} elseif ( 'thumbnail' === $canuckcp_home_feature ) {
?>
<div id="feature-slider-wide">
<div id="feature-slider-wrap">
<?php
if ( '' === $canuckcp_feature_category ) {
?>
<span class="error"><?php esc_html_e( 'You need to select a category in the \"Canuck Home Page => Home Feature Options\" panel!', 'canuck-cp' ); ?></span>
<?php
} else {
get_template_part( '/template-parts/feature-slider-parts/slider', 'thumbnail' );
}
?>
</div>
</div>
<?php
} elseif ( 'widgetized' === $canuckcp_home_feature ) {
?>
<div id="feature-slider-wide">
<div id="feature-slider-wrap">
<?php
if ( ! dynamic_sidebar( 'canuckcp_home_feature' ) ) {
echo '<span class="feature-no-video">' .
esc_html__( 'Your Home page Feature area is set up for widgets.', 'canuck-cp' ) .
'<br/>' .
esc_html__( 'Go to Appearance->Widgets or the Customizer Widgets panel and add a widget to Home Page Feature.', 'canuck-cp' ) .
'</span>';
}
?>
</div>
</div>
<?php
}
?>
<div id="main-section-home">
<div id="content-wrap-home">
<div id="fullwidth-home">
<?php canuckcp_home_page_sections(); ?>
</div>
</div>
</div>
<div class="clearfix"></div>
<?php
get_footer();