forked from striebwj/canuck-cp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
165 lines (164 loc) · 5.69 KB
/
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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?php
/**
* Blog Page template file.
*
* This file is used for all blog pages.
*
* @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_include_breadcrumbs, $canuckcp_exclude_page_title, $canuckcp_feature_category;
$canuckcp_layout_option = esc_html( get_theme_mod( 'canuckcp_blog_layout', 'right_sidebar' ) );
$canuckcp_include_breadcrumbs = get_theme_mod( 'canuckcp_breadcrumbs' ) ? true : false;
$canuckcp_exclude_page_title = get_theme_mod( 'canuckcp_blog_title_option' ) ? true : false;
$post_style = esc_html( get_theme_mod( 'canuckcp_blog_style', 'top_feature' ) );
$blog_feature = get_theme_mod( 'canuckcp_blog_feature', 'background_image' );
$canuckcp_feature_category = get_theme_mod( 'canuckcp_blog_feature_category', '' );
get_header( 'blog' );
if ( 'button_nav' === $blog_feature ) {
?>
<div id="feature-slider-wide">
<div id="feature-slider-wrap">
<?php
if ( '' === $canuckcp_feature_category ) {
?>
<span class="error"><?php esc_html_e( 'Go to Canuck Options=>Blog and enter the Feature Category you used for your posts.', 'canuck-cp' ); ?></span>
<?php
} else {
get_template_part( '/template-parts/feature-slider-parts/slider', 'button-nav-3to1' );
}
?>
</div>
</div>
<?php
} elseif ( 'fullsize' === $blog_feature ) {
?>
<div id="feature-slider-wide">
<div id="feature-slider-wrap">
<?php
if ( '' === $canuckcp_feature_category ) {
?>
<span class="error"><?php esc_html_e( 'Go to Canuck Options=>Blog and enter the Feature Category you used for your posts.', 'canuck-cp' ); ?></span>
<?php
} else {
get_template_part( '/template-parts/feature-slider-parts/slider', 'button-nav-fullsize' );
}
?>
</div>
</div>
<?php
} elseif ( 'thumbnail' === $blog_feature ) {
?>
<div id="feature-slider-wide">
<div id="feature-slider-wrap">
<?php
if ( '' === $canuckcp_feature_category ) {
?>
<span class="error"><?php esc_html_e( 'Go to Canuck Options=>Blog and enter the Feature Category you used for your posts.', 'canuck-cp' ); ?></span>
<?php
} else {
get_template_part( '/template-parts/feature-slider-parts/slider', 'thumbnail' );
}
?>
</div>
</div>
<?php
} elseif ( 'widgetized' === $blog_feature ) {
?>
<div id="feature-slider-wide">
<div id="feature-slider-wrap">
<?php
if ( ! dynamic_sidebar( 'canuckcp_blog_feature' ) ) {
echo '<span class="feature-no-video">' .
esc_html__( 'Your Blog 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 Blog Page Feature.', 'canuck-cp' ) .
'</span>';
}
?>
</div>
</div>
<?php
}
get_template_part( '/template-parts/partials', 'page-title' );
?>
<div id="main-section">
<div id="content-wrap">
<?php
if ( 'left_sidebar' === $canuckcp_layout_option ) {
?>
<aside id="two-column-sidebar-left" class="toggle-sb-a">
<?php get_template_part( '/template-parts/sidebars/sidebar', 'blog-a' ); ?>
</aside>
<div id="two-column-content">
<?php
if ( 'side_feature' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'side-feature' );
} elseif ( 'two_column_grid' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'two-col-posts' );
} elseif ( 'two_stamp' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'two-stamp' );
} else {
get_template_part( '/template-parts/blog-parts/blog', 'top-feature' );
}
?>
</div>
<?php
} elseif ( 'both_sidebars' === $canuckcp_layout_option ) {
?>
<aside id="three-column-sidebar-left" class="toggle-sb-a">
<?php get_template_part( '/template-parts/sidebars/sidebar', 'blog-a' ); ?>
</aside>
<div id="three-column-content">
<?php get_template_part( '/template-parts/blog-parts/blog', 'top-feature' ); ?>
</div>
<aside id="three-column-sidebar-right" class="toggle-sb-b">
<?php get_template_part( '/template-parts/sidebars/sidebar', 'blog-b' ); ?>
</aside>
<?php
} elseif ( 'fullwidth' === $canuckcp_layout_option ) {
?>
<div id="fullwidth">
<?php
if ( 'two_column_grid' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'two-col-posts' );
} elseif ( 'three_column_grid' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'three-col-posts' );
} elseif ( 'two_stamp' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'two-stamp' );
} elseif ( 'three_stamp' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'three-stamp' );
} else {
get_template_part( '/template-parts/blog-parts/blog', 'side-feature' );
}
?>
</div>
<?php
} else {
?>
<div id="two-column-content">
<?php
if ( 'side_feature' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'side-feature' );
} elseif ( 'two_column_grid' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'two-col-posts' );
} elseif ( 'two_stamp' === $post_style ) {
get_template_part( '/template-parts/blog-parts/blog', 'two-stamp' );
} else {
get_template_part( '/template-parts/blog-parts/blog', 'top-feature' );
}
?>
</div>
<aside id="two-column-sidebar-right" class="toggle-sb-b">
<?php get_template_part( '/template-parts/sidebars/sidebar', 'blog-a' ); ?>
</aside>
<?php
}
?>
</div>
</div>
<div class="clearfix"></div>
<?php
get_footer();