-
Notifications
You must be signed in to change notification settings - Fork 12
/
sidebar.php
executable file
·34 lines (29 loc) · 925 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
<?php
/**
* The sidebar containing the main widget area.
*
* @package Rookie
*/
if ( ! is_active_sidebar( 'sidebar-1' ) && ! is_active_sidebar( 'sidebar-2' ) ) {
return;
}
$sidebar = rookie_get_sidebar_setting();
// Initialize counter
$i = 1;
// Output left sidebar
if ( in_array( $sidebar, array( 'left', 'double' ) ) ) {
?>
<div id="secondary" class="widget-area widget-area-left<?php if ( 'double' === $sidebar ) { ?> widget-area-narrow<?php } ?>" role="complementary">
<?php dynamic_sidebar( 'sidebar-' . $i ); ?>
</div><!-- #secondary -->
<?php
$i++;
}
// Output right sidebar
if ( in_array( $sidebar, array( 'right', 'double' ) ) ) {
?>
<div id="secondary<?php if ( $i > 1 ) { echo '-' . $i; } ?>" class="widget-area widget-area-right<?php if ( 'double' === $sidebar ) { ?> widget-area-narrow<?php } ?>" role="complementary">
<?php dynamic_sidebar( 'sidebar-' . $i ); ?>
</div><!-- #secondary -->
<?php
}