/
header.php
304 lines (289 loc) · 9.98 KB
/
header.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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<?php
/**
* Header Template Part
*
* Template part file that contains the HTML document head and
* opening HTML body elements, as well as the site header and
* "infobar".
*
* This file is called by all primary template pages
*
* Child Themes can override this template part file globally,
* via "header.php", or in a given specific context, via
* "header-{context}.php". For example, to replace this
* template part file on static Pages, a Child Theme would
* include the file "header-page.php".
*
* @uses oenology_get_context() Defined in /functions/custom.php
* @uses oenology_get_options() Defined in /functions/options.php
* @uses oenology_hook_extent_before() Defined in /functions/hooks.php
*
* @link http://codex.wordpress.org/Function_Reference/bloginfo bloginfo()
* @link http://codex.wordpress.org/Function_Reference/body_class body_class()
* @link http://codex.wordpress.org/Function_Reference/get_option get_option()
* @link http://codex.wordpress.org/Function_Reference/get_stylesheet_uri get_stylesheet_uri()
* @link http://codex.wordpress.org/Function_Reference/get_template_part get_template_part()
* @link http://codex.wordpress.org/Function_Reference/is_front_page is_front_page()
* @link http://codex.wordpress.org/Function_Reference/is_page is_page()
* @link http://codex.wordpress.org/Function_Reference/language_attributes language_attributes()
* @link http://codex.wordpress.org/Function_Reference/wp_head wp_head()
* @link http://codex.wordpress.org/Function_Reference/wp_title wp_title()
*
* @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 1.0
*/
/**
* Global variable that contains the
* Theme's options array.
*
* @global array $oenology_options
*/
global $oenology_options;
/**
* Return a value from the wp_options database table
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/get_option get_option}
*
* Returns the value for a defined option in the WordPress wp-options
* database table. If the option does not exist, get_option() returns
* 'false', or the value passed via the $default parameter.
*
* get_option() returns, but does not print/display, the value requested
*
* @param string $show database option to return
* @param string $default default value to return if null; default: false
* @return mixed value of specified option
*/
$oenology_options = oenology_get_options();
?><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php
/**
* Output language attributes for the <html> tag
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/language_attributes language_attributes}
*
* Added inside the HTML <html> tag, and outputs various HTML
* language attributes, such as language and text-direction.
*
* @param null
* @return string e.g. dir="ltr" lang="en-US"
*/
language_attributes();
?>>
<head profile="http://gmpg.org/xfn/11">
<?php
?>
<meta http-equiv="Content-Type" content="<?php
/**
* Output the site HTML type
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/bloginfo bloginfo}
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/get_bloginfo get_bloginfo}
*
* bloginfo() prints (displays/outputs) the data requested.
* get_bloginfo() returns, rather than display/output, the data
*
* The 'html_type' parameter is the document HTML type
* - Defined on the General Settings page in the administration panel
* - Usually "text/html"
*
* @param string $show e.g. 'html_type'; default: none
* @return string e.g. "text/html"
*/
bloginfo( 'html_type' );
?>; charset=<?php
/**
* Output the site HTML type
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/bloginfo bloginfo}
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/get_bloginfo get_bloginfo}
*
* bloginfo() prints (displays/outputs) the data requested.
* get_bloginfo() returns, rather than display/output, the data
*
* The 'charset' parameter is the document character set
* - Defined in wp-config.php
* - Usually "UTF-8"
*
* @param string $show e.g. 'charset'; default: none
* @return string e.g. "UTF-8"
*/
bloginfo( 'charset' );
?>" />
<title><?php
/**
* Output HTML <title> tag content,
* based on current page context
*
* Codex reference: {@link http://codex.wordpress.org/Template_Tags/wp_title wp_title}
*
* Outputs HTML <title> tag content, including context-specific content,
* such as the Post Title for single posts, the Date for date-based archive,
* Category for category archive, etc.
*
* This content can be filtered, via the 'wp_title' filter. Modifying output via this filter
* rather than hard-coding output inside the <title> tags is the best-practice approach, as
* this approach facilitates modification of the title content by Plugins (or by future core
* changes). Oenology applies custom content using this filter, via the oenology_filter_wp_title()
* function in \functions\wordpress-hooks.php.
*
* @see oenology_filter_wp_title()
*
* @param string $sep separator to use before/after Post Title; default: '»'
* @param bool $echo whether to echo or return output; default: true
* @param string $seplocation location of separator, left or right of Post Title; default: none (left)
*
* @return string
*/
wp_title( '»', true, 'right' );
?></title>
<link rel="stylesheet" href="<?php
/**
* Return the URL for the default stylesheet
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/get_stylesheet_uri get_stylesheet_uri}
*
* Returns the value for the URI of the Theme default style sheet (style.css).
*
* @param null
* @return string URL of default stylesheet
*/
echo get_stylesheet_uri();
?>" type="text/css" media="all" />
<?php
/**
* Fire the 'wp_head' action hook
*
* Codex reference: {@link http://codex.wordpress.org/Hook_Reference/wp_head wp_head}
*
* This hook is used by WordPress core, Themes, and Plugins to
* add scripts, CSS styles, meta tags, etc. to the document head.
*
* MUST come immediately before the closing </head> tag
*
* @param null
* @return mixed any output hooked into 'wp_head'
*/
wp_head();
?>
</head>
<!-- End HTML Header -->
<?php
/**
* oenology_get_context()
*
* Output HTML <body> tag CSS ID attribute content,
* based on current page context
*
* @param null
* @return string current page context; default: "index"
*
* body_class()
*
* Output HTML <body> tag "class" attribute,
* based on current page context
*
* @param string|array $class additional classes to add; default: none
* @return string list of classes
*/
?>
<body id="<?php echo oenology_get_context(); ?>" <?php body_class(); ?>>
<!-- Begin Extent (div#extent) -->
<?php
/**
* div#extent contains all displayed content,
* including the site header, main content,
* sidebars, and sitefooter.
*/
?>
<div id="extent">
<?php
/**
* Fire the 'oenology_hook_extent_before' custom action hook
*
* @param null
* @return mixed any output hooked into 'oenology_hook_extent_before'
*/
oenology_hook_extent_before();
?>
<!-- Begin Header (div#header)-->
<?php
/**
* div#header contains the Main Navigation Menu,
* Blog Title and Blog description.
*/
?>
<div id="header">
<!-- Begin Blog Head -->
<?php
/**
* Include the site-header Theme template part file
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/get_template_part get_template_part}
*
* get_template_part( $slug ) will attempt to include $slug.php.
* The function will attempt to include files in the following
* order, until it finds one that exists: the Theme's $slug.php,
* the parent Theme's $slug.php
*
* get_template_part( $slug , $name ) will attempt to include
* $slug-$name.php. The function will attempt to include files
* in the following order, until it finds one that exists: the
* Theme's $slug-$name.php, the Theme's $slug.php, the parent
* Theme's $slug-$name.php, the parent Theme's $slug.php
*
* Child Themes can replace this template part file globally,
* via "site-header.php", or in a specific context only, via
* "site-header-{context}.php"
*/
get_template_part( 'site-header', oenology_get_context() );
?>
<!-- End Blog Head -->
</div>
<!-- End Header (div#header) -->
<!-- Begin Infobar (div#infobar) -->
<?php
/**
* div#infobar contains the site breadcrumb navigation,
* login/admin links, and search form.
*/
?>
<div id="infobar">
<?php
/**
* Include the infobar Theme template part file
*
* Codex reference: {@link http://codex.wordpress.org/Function_Reference/get_template_part get_template_part}
*
* get_template_part( $slug ) will attempt to include $slug.php.
* The function will attempt to include files in the following
* order, until it finds one that exists: the Theme's $slug.php,
* the parent Theme's $slug.php
*
* get_template_part( $slug , $name ) will attempt to include
* $slug-$name.php. The function will attempt to include files
* in the following order, until it finds one that exists: the
* Theme's $slug-$name.php, the Theme's $slug.php, the parent
* Theme's $slug-$name.php, the parent Theme's $slug.php
*
* Child Themes can replace this template part file globally,
* via "infobar.php", or in a specific context only, via
* "infobar-{context}.php"
*/
get_template_part( 'infobar', oenology_get_context() );
?>
</div>
<!-- End Infobar (div#infobar) -->
<!-- Begin Content (div#content) -->
<?php
/**
* div#content contains the site main content
* (left column, center column, right column).
*/
?>
<div id="content">