forked from tomjn/wp-gitbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebar.php
40 lines (39 loc) · 1.1 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
<div class="book-summary">
<div id="book-search-input" role="search">
<form method="get" action="<?php echo esc_url( home_url() ); ?>">
<input type="text" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" placeholder="Type and press enter to search">
</form>
</div>
<nav role="navigation">
<?php do_action( 'before_sidebar' ); ?>
<ul class="summary">
<li<?php
if ( is_home() ) {
echo ' class="active"';
} ?>>
<a href="<?php echo esc_url( home_url() ); ?>" class="custom-link"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></a>
</li>
<li class="divider"></li>
</ul>
<?php
if ( has_nav_menu( 'summary' ) ) {
$args = array(
'theme_location' => 'summary',
'menu_class' => 'summary',
'container' => '',
);
wp_nav_menu( $args );
} else if ( is_user_logged_in() ) {
?>
<ul class="summary">
<li>
<a href="<?php echo admin_url( 'nav-menus.php' ); ?>" target="_blank" class="custom-link">Click to add the menu</a>
</li>
<li class="divider"></li>
</ul>
<?php
}
do_action( 'after_sidebar' );
?>
</nav>
</div>