forked from striebwj/canuck-cp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.php
88 lines (86 loc) · 3.37 KB
/
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
<?php
/**
* This file is the default Page template file, used to display static
* Pages if no custom Page template is defined.
*
* @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_layout_option = sanitize_text_field( ( '' === get_post_meta( $post->ID, 'canuckcp_metabox_page_layout', true ) ? 'right_sidebar' : get_post_meta( $post->ID, 'canuckcp_metabox_page_layout', true ) ) );
$canuckcp_include_breadcrumbs = get_theme_mod( 'canuckcp_breadcrumbs' ) ? true : false;
$canuckcp_exclude_page_title = get_post_meta( $post->ID, 'canuckcp_metabox_title', true ) ? true : false;
$canuckcp_sidebar_a = esc_html( ( '' === get_post_meta( $post->ID, 'canuckcp_metabox_sidebar_a', true ) ? 'default-a' : get_post_meta( $post->ID, 'canuckcp_metabox_sidebar_a', true ) ) );
$canuckcp_sidebar_b = esc_html( ( '' === get_post_meta( $post->ID, 'canuckcp_metabox_sidebar_b', true ) ? 'default-b' : get_post_meta( $post->ID, 'canuckcp_metabox_sidebar_b', true ) ) );
$canuckcp_exclude_page_share = get_post_meta( $post->ID, 'canuckcp_exclude_share', true ) ? true : false;
get_header();
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', $canuckcp_sidebar_a ); ?>
</aside>
<div id="two-column-content">
<?php
get_template_part( '/template-parts/partials', 'page-post' );
if ( ! $canuckcp_exclude_page_share && canuckcp_page_share() ) {
echo canuckcp_page_share();// phpcs:ignore
}
?>
</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', $canuckcp_sidebar_a ); ?>
</aside>
<div id="three-column-content">
<?php
get_template_part( '/template-parts/partials', 'page-post' );
if ( ! $canuckcp_exclude_page_share && canuckcp_page_share() ) {
echo canuckcp_page_share();// phpcs:ignore
}
?>
</div>
<aside id="three-column-sidebar-right" class="toggle-sb-b">
<?php get_template_part( '/template-parts/sidebars/sidebar', $canuckcp_sidebar_b ); ?>
</aside>
<?php
} elseif ( 'fullwidth' === $canuckcp_layout_option ) {
?>
<div id="fullwidth">
<?php
get_template_part( '/template-parts/partials', 'page-post' );
if ( ! $canuckcp_exclude_page_share && canuckcp_page_share() ) {
echo canuckcp_page_share();// phpcs:ignore
}
?>
</div>
<?php
} else {
?>
<div id="two-column-content">
<?php
get_template_part( '/template-parts/partials', 'page-post' );
if ( ! $canuckcp_exclude_page_share && canuckcp_page_share() ) {
echo canuckcp_page_share();// phpcs:ignore
}
?>
</div>
<aside id="two-column-sidebar-right" class="toggle-sb-b">
<?php get_template_part( '/template-parts/sidebars/sidebar', $canuckcp_sidebar_a ); ?>
</aside>
<?php
}
?>
</div>
</div>
<div class="clearfix"></div>
<?php
get_footer();