-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsidebar.php
More file actions
43 lines (37 loc) · 1.1 KB
/
sidebar.php
File metadata and controls
43 lines (37 loc) · 1.1 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
<?php
/**
* Sidebar Template
*
* Display the sidebar widgets. Will not output anything if there's no widgets
* assigned to specified sidebar.
*
* Also includes the `before_sidebar` hook. This is used by
* {@link wordpress.com} to display WordAds {@link https://wordads.co}.
*
* A body class is added if the theme has widgets to display here
* {@see granule_body_class}. This helps with custom css that adjusts the page
* when no widgets exist.
*
* @link https://developer.wordpress.org/themes/template-files-section/partial-and-miscellaneous-template-files/#sidebar-php
*
* @package Granule
* @subpackage TemplatePart
* @author Ben Gillbanks <ben@prothemedesign.com>
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License
*/
// Don't display on full width page.
if ( is_page_template( 'templates/full-width-page.php' ) ) {
return;
}
// Quit if sidebar has no content.
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
return;
}
?>
<!-- Sidebar Main (1) -->
<aside class="sidebar sidebar-main">
<?php
do_action( 'before_sidebar' );
dynamic_sidebar( 'sidebar-1' );
?>
</aside>