-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsidebar.php
47 lines (34 loc) · 946 Bytes
/
sidebar.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
<?php
/**
* The Sidebar containing the main widget areas.
*
* @package lsx
*/
$sidebar_enabled = apply_filters( 'lsx_sidebar_enable', true );
if ( true !== $sidebar_enabled ) {
return true;
}
$show_on_front = get_option( 'show_on_front' );
if ( 'page' === $show_on_front && is_front_page() ) {
$layout = '1c';
$sidebar = 'home';
} else {
$layout = get_theme_mod( 'lsx_layout', '2cr' );
$layout = apply_filters( 'lsx_layout', $layout );
if ( 'posts' === $show_on_front && is_home() ) {
$sidebar = 'home';
} else {
$sidebar = 'sidebar-1';
}
}
if ( '1c' !== $layout ) : ?>
<?php lsx_sidebars_before(); ?>
<div id="secondary" class="widget-area <?php echo esc_attr( lsx_sidebar_class() ); ?>" role="complementary">
<?php lsx_sidebar_top(); ?>
<?php if ( ! dynamic_sidebar( $sidebar ) ) : ?>
<?php endif; ?>
<?php lsx_sidebar_bottom(); ?>
</div><!-- #secondary -->
<?php lsx_sidebars_after(); ?>
<?php
endif;