-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsidebar.php
252 lines (237 loc) · 7.97 KB
/
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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?php
/**
* Template part file that contains the default sidebar content
*
* This file is called by all primary template pages
*
* @uses oenology_get_current_page_layout() Defined in /functions/custom.php
* @uses oenology_get_social_networks() Defined in /functions/custom.php
*
* @link http://codex.wordpress.org/Function_Reference/dynamic_sidebar dynamic_sidebar()
* @link http://codex.wordpress.org/Function_Reference/get_bloginfo get_bloginfo()
* @link http://codex.wordpress.org/Function_Reference/get_option get_option()
* @link http://codex.wordpress.org/Function_Reference/get_sidebar get_sidebar()
* @link http://codex.wordpress.org/Function_Reference/has_post_format has_post_format()
* @link http://codex.wordpress.org/Function_Reference/is_active_sidebar is_active_sidebar()
* @link http://codex.wordpress.org/Function_Reference/is_attachment is_attachment()
* @link http://codex.wordpress.org/Function_Reference/is_front_page is_front_page()
* @link http://codex.wordpress.org/Function_Reference/is_single is_single()
*
* @package Oenology
* @copyright Copyright (c) 2010, Chip Bennett
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
*
* @since Oenology 2.0
*/
// Globalize the variable that contains the Theme's options array.
global $oenology_options;
// Do not display sidebars on attachment pages or posts with format-types "gallery", "image", or "video".
if ( in_array( oenology_get_current_page_layout(), array( 'one-column', 'attachment', 'full' ) ) ) {
return;
}
// Current layout is not three-column.
if ( 'three-column' != oenology_get_current_page_layout() ) {
?>
<?php
/**
* Fire the 'oenology_hook_sidebars_before' custom action hook
*
* @param null
* @return mixed any output hooked into 'oenology_hook_sidebars_before'
*/
oenology_hook_sidebars_before();
?>
<div id="sidebar-doublecol">
<?php
/**
* Fire the 'oenology_hook_sidebars_top' custom action hook
*
* @param null
* @return mixed any output hooked into 'oenology_hook_sidebars_top'
*/
oenology_hook_sidebars_top();
?>
<?php
/**
* Only display div#doublecoltop if dynamic sidebar
* 'sidebar-column-top is active, or if the Theme is
* set to display social icons
*/
if
(
// WordPress conditional tag that returns true if the specified dynamic sidebar is active (has Widgets assigned to it).
is_active_sidebar( 'sidebar-column-top' )
) {
?>
<?php
/**
* Container div#doublecoltop is the top, right-colum content in the two-column
* layout. It displays only on static Pages, including static Page as
* Front Page, and is a double-width column, and displays above the
* single-width columns div#leftcol and div#rightcol.
*
* Includes the 'sidebar-column-top' dynamic sidebar,
* and displays only if this dynamic sidebar is active (has Widgets
* assigned to it), or if the Theme is set to display social icons.
*/
?>
<div id="doublecoltop">
<!-- Begin Sidebar Top Widget Area-->
<?php
/**
* Output a dynamic sidebar
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/dynamic_sidebar}
*
* Outputs the specified dynamic sidebar. A dynamic sidebar
* is used to output Widgets as specified by the user.
*/
dynamic_sidebar( 'sidebar-column-top' );
?>
<!-- End Sidebar Top Widget Area-->
</div>
<?php
}
}
?>
<!-- Begin Left Column (div#leftcol) -->
<?php
/**
* Container div#leftcol contains the left column content of the three-column
* layout. For the Blog Posts Index, div#rightcol and div#leftcol both
* appear to the right of the main content column. For static Pages,
* including a static Page as Front Page, div#leftcol is to the left,
* and div#rightcol is to the right, with div#main in the center.
*
* Includes the 'sidebar-left' dynamic sidebar
*/
?>
<div id="leftcol">
<!-- Begin Left Column Widget Area-->
<?php
/**
* Display default sidebar content if the following conditions are true:
* - Dynamic sidebar 'sidebar-right' is not active, AND
* - A static Page as Front Page is not being displayed
*/
if (
// WordPress conditional tag that returns true if the specified dynamic sidebar is active.
! dynamic_sidebar( 'sidebar-left' )
&& ! (
// WordPress conditional tag that returns true if the current page is the Front Page.
is_front_page()
// Returns true if the Front Page is set to display a static Page.
&& 'page' == get_option('show_on_front') )
) {
/**
* Calls a sidebar template part file.
* Used in all primary template pages.
*
* Codex reference: http://codex.wordpress.org/Function_Reference/get_sidebar
*
* Child Themes can replace this template part file globally,
* via "sidebar-left.php"
*/
get_sidebar( 'left' );
}
?>
<!-- End Left Column Widget Area-->
</div>
<!-- End Left Column (div#leftcol) -->
<!-- Begin Right Column (div#rightcol) -->
<?php
/**
* Container div#rightcol contains the right column content of the three-column
* layout. For the Blog Posts Index, div#rightcol and div#leftcol both
* appear to the right of the main content column. For static Pages,
* including a static Page as Front Page, div#leftcol is to the left,
* and div#rightcol is to the right, with div#main in the center.
*
* Includes the 'sidebar-right' dynamic sidebar
*/
?>
<div id="rightcol">
<!-- Begin Right Column Widget Area-->
<?php
/**
* Display default sidebar content if the following conditions are true:
* - Dynamic sidebar 'sidebar-right' is not active, AND
* - A static Page as Front Page is not being displayed
*/
if (
// WordPress conditional tag that returns true if the specified dynamic sidebar is active.
! dynamic_sidebar( 'sidebar-right' )
&& ! (
// WordPress conditional tag that returns true if the current page is the Front Page.
is_front_page()
// Returns true if the Front Page is set to display a static Page.
&& 'page' == get_option('show_on_front') )
) {
/**
* Calls a sidebar template part file.
* Used in all primary template pages.
*
* Codex reference: http://codex.wordpress.org/Function_Reference/get_sidebar
*
* Child Themes can replace this template part file globally,
* via "sidebar-right.php"
*/
get_sidebar( 'right' );
}
?>
<!-- End Right Column Widget Area -->
</div>
<!-- End Right Column (div#rightcol) -->
<?php
// Current page layout is not three-column.
if ( 'three-column' != oenology_get_current_page_layout() ) {
// WordPress conditional tag that returns true if the specified dynamic sidebar is active (has Widgets assigned to it).
if ( is_active_sidebar( 'sidebar-column-bottom' ) ) {
/**
* Container div#doublecolbottom is the bottom, right-colum content in the two-column
* layout. It displays only on static Pages, including static Page as
* Front Page, and is a double-width column, and displays above the
* single-width columns div#leftcol and div#rightcol.
*
* Includes sthe 'sidebar-column-bottom' dynamic sidebar, and displays only
* if this sidebar is active (has Widgets assigned to it).
*/
?>
<div id="doublecolbottom">
<!-- Begin Sidebar Bottom Widget Area-->
<?php
/**
* Output a dynamic sidebar
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/dynamic_sidebar}
*
* Outputs the specified dynamic sidebar. A dynamic sidebar
* is used to output Widgets as specified by the user.
*/
dynamic_sidebar( 'sidebar-column-bottom' );
?>
<!-- End Sidebar Bottom Widget Area-->
</div>
<?php
}
?>
<?php
/**
* Fire the 'oenology_hook_sidebars_bottom' custom action hook
*
* @return mixed any output hooked into 'oenology_hook_sidebars_bottom'
*/
oenology_hook_sidebars_bottom();
?>
</div>
<?php
/**
* Fire the 'oenology_hook_sidebars_after' custom action hook
*
* @return mixed any output hooked into 'oenology_hook_sidebars_after'
*/
oenology_hook_sidebars_after();
?>
<?php
}
?>