This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsidebar.php
75 lines (59 loc) · 2.15 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
<?php
/**
* The sidebar containing the flyout widget area.
*
* @package York Pro
* @link https://themebeans.com/themes/york-pro
*/
// Add a class if there is no widget area active.
$is_active = ( ! is_active_sidebar( 'sidebar-1' ) ) ? 'no-widget-area' : 'has-widget-area'; ?>
<div id="nav-close" class="nav-close-overlay"></div>
<aside id="secondary" class="sidebar <?php echo esc_attr( $is_active ); ?>">
<div class="hamburger hamburger--spin mobile-menu-toggle close-toggle">
<div class="hamburger-box">
<div class="hamburger-inner"></div>
</div>
</div>
<div class="sidebar--section">
<div class="sidebar--section-inner">
<?php if ( has_nav_menu( 'primary' ) ) : ?>
<nav id="site-navigation" class="main-navigation nav primary" aria-label="<?php esc_attr_e( 'Primary Menu', 'york-pro' ); ?>">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'menu_class' => 'primary-menu',
'depth' => '2',
'link_before' => '<span>',
'link_after' => '</span>',
'walker' => new YorkClassMobileNavigationWalker(),
)
);
?>
</nav><!-- .main-navigation -->
<?php endif; ?>
<?php
if ( true === get_theme_mod( 'nav_social_icons', york_defaults( 'nav_social_icons' ) ) || is_customize_preview() ) :
/*
* If selected in the Customizer.
* The visibility classes area used to show/hide the elements in the Customizer live preview.
*/
$visibility = ( false === get_theme_mod( 'nav_social_icons', york_defaults( 'nav_social_icons' ) ) ) ? 'hidden' : '';
?>
<div class="sidebar-social <?php echo esc_attr( $visibility ); ?>">
<?php york_social_navigation(); ?>
</div>
<?php endif; ?>
</div>
</div>
<?php
if ( is_active_sidebar( 'sidebar-1' ) ) :
$flyout_layout = ( 'standard' === get_theme_mod( 'flyout_layout', york_defaults( 'flyout_layout' ) ) ) ? 'not-vertically-centered' : '';
?>
<div class="sidebar--section widget-area <?php echo esc_attr( $flyout_layout ); ?>">
<div class="sidebar--section-inner">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</div>
</div>
<?php endif; ?>
</aside>