forked from cyberchimps/responsive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidebar.php
More file actions
103 lines (81 loc) · 4.2 KB
/
sidebar.php
File metadata and controls
103 lines (81 loc) · 4.2 KB
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
<?php
/**
* Main Widget Template
*
* @file sidebar.php
* @package Responsive
* @author CyberChimps
* @copyright 2020 CyberChimps
* @license license.txt
* @version Release: 1.0
* @filesource wp-content/themes/responsive/sidebar.php
* @link http://codex.wordpress.org/Theme_Development#secondary_.28sidebar.php.29
* @since available since Release 1.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
Responsive\responsive_widgets_before(); // above widgets container hook.
if ( ( class_exists( 'WooCommerce' ) && ( is_woocommerce() || is_cart() || is_checkout() ) ) ) {
if ( ( ( ( is_page() && ! is_checkout() ) && ( is_page() && ! is_cart() ) ) && 'no' === get_theme_mod( 'responsive_page_sidebar_position', 'right' ) ) ||
( is_page() && 'no' === get_post_meta( get_the_ID(), 'responsive_page_meta_sidebar_position', true ) ) ||
( ( is_single() && ( ! is_woocommerce() && ! is_product() ) ) && 'no' === get_theme_mod( 'responsive_single_blog_sidebar_position', 'right' ) ) ||
( ( is_woocommerce() && is_product() ) && 'no' === get_theme_mod( 'responsive_single_product_sidebar_position', 'right' ) ) ||
( ( is_home() || is_search() || is_archive() && ( ! is_woocommerce() && ! is_shop() ) ) && 'no' === get_theme_mod( 'responsive_blog_sidebar_position', 'right' ) ) ||
( ( is_woocommerce() && is_shop() ) && 'no' === get_theme_mod( 'responsive_shop_sidebar_position', 'right' ) )
) {
return;
}
$responsive_options = Responsive\Core\responsive_get_options();
if ( ( 'no' === get_theme_mod( 'responsive_shop_sidebar_position', 'no' ) && ! is_product() ) || ( 'no' === get_theme_mod( 'responsive_single_product_sidebar_position', 'no' ) && is_product() ) ) {
return;
}
?>
<aside id="secondary" class="widget-area <?php echo esc_attr( implode( ' ', responsive_get_sidebar_classes() ) ); ?>" role="complementary" <?php responsive_schema_markup( 'sidebar' ); ?>>
<?php dynamic_sidebar( 'responsive-woo-shop-sidebar' ); ?>
</aside>
<?php
} elseif ( class_exists( 'LifterLMS' ) ) {
if ( in_array('post-type-archive-course', get_body_class()) || in_array('post-type-archive-llms_membership', get_body_class()) ) {
return;
} else {
if ( ( is_page() && 'no' === get_theme_mod( 'responsive_page_sidebar_position', 'right' ) ) ||
( is_page() && 'no' === get_post_meta( get_the_ID(), 'responsive_page_meta_sidebar_position', true ) ) ||
( is_single() && 'no' === get_theme_mod( 'responsive_single_blog_sidebar_position', 'right' ) ) ||
( ( is_home() || is_search() || is_archive() ) && 'no' === get_theme_mod( 'responsive_blog_sidebar_position', 'right' ) )
) {
return;
}
?>
<aside id="secondary" class="main-sidebar widget-area <?php echo esc_attr( implode( ' ', responsive_get_sidebar_classes() ) ); ?>" role="complementary" <?php responsive_schema_markup( 'sidebar' ); ?>>
<?php
Responsive\responsive_widgets(); // above widgets hook.
if ( ! dynamic_sidebar( 'main-sidebar' ) ) :
endif; // End of main-sidebar.
Responsive\responsive_widgets_end(); // after widgets hook.
?>
</aside><!-- end of #secondary -->
<?php
Responsive\responsive_widgets_after(); // after widgets container hook.
}
} else {
if ( ( is_page() && 'no' === get_theme_mod( 'responsive_page_sidebar_position', 'right' ) ) ||
( is_page() && 'no' === get_post_meta( get_the_ID(), 'responsive_page_meta_sidebar_position', true ) ) ||
( is_single() && 'no' === get_theme_mod( 'responsive_single_blog_sidebar_position', 'right' ) ) ||
( ( is_home() || is_search() || is_archive() ) && 'no' === get_theme_mod( 'responsive_blog_sidebar_position', 'right' ) )
) {
return;
}
?>
<aside id="secondary" class="main-sidebar widget-area <?php echo esc_attr( implode( ' ', responsive_get_sidebar_classes() ) ); ?>" role="complementary" <?php responsive_schema_markup( 'sidebar' ); ?>>
<?php
Responsive\responsive_widgets(); // above widgets hook.
if ( ! dynamic_sidebar( 'main-sidebar' ) ) :
endif; // End of main-sidebar.
Responsive\responsive_widgets_end(); // after widgets hook.
?>
</aside><!-- end of #secondary -->
<?php
Responsive\responsive_widgets_after(); // after widgets container hook.
}