forked from quantixed/gitsta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
122 lines (111 loc) · 5.14 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
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<?php
if(get_gitsta_theme_option('favicon_url') != ''):
?>
<?php
endif;
?>
<?php
if(is_singular() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_head();
?>
<?php
if(is_admin_bar_showing()):
?>
<style>
.navbar {
padding-top: 32px;
}
</style>
<?php
endif;
?>
</head>
<body <?php body_class(); ?>>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<!-- Nav button for small resolutions -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-menu">
<span class="sr-only"><?php _e('Toggle navigation', 'gitsta'); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo get_home_url(); ?>"><?php bloginfo('name'); ?></a>
</div>
<div class="collapse navbar-collapse" id="main-menu">
<?php
// Navigation
$gitsta_nav_args = array(
'theme_location' => 'top-bar',
'menu' => 'primary',
'container' => false,
'menu_class' => 'nav navbar-nav',
'walker' => new wp_bootstrap_navwalker(),
'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
);
wp_nav_menu($gitsta_nav_args);
// see searchform.php
get_search_form();
?>
<div class="btn-group pull-right">
<?php
// Dropdown for anonymous users
if( ! is_user_logged_in()):
?>
<a href="#" class="btn navbar-btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <?php _e('Anonymous', 'gitsta'); ?> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="<?php echo wp_login_url(); ?>"><?php _e('Login', 'gitsta'); ?></a></li>
<li class="divider"></li>
<li><a href="<?php echo wp_login_url(get_permalink()); ?>"><?php _e('Register', 'gitsta'); ?></a></li>
<li><a href="<?php echo wp_lostpassword_url(); ?>"><?php _e('Lost password', 'gitsta'); ?></a></li>
</ul>
<?php
// Dropdown for logged users
else:
global $current_user;
?>
<a href="#" class="btn navbar-btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <?php echo $current_user->user_login; ?> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="<?php echo admin_url(); ?>"><?php _e('Dashboard', 'gitsta'); ?></a></li>
<?php
// A link for gust, if installed
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if(current_user_can('publish_posts') && is_plugin_active('gust/gust.php')):
?>
<li><a href="<?php echo esc_url(home_url('/gust')); ?>"><?php _e('Gust', 'gitsta'); ?></a></li>
<?php
endif;
?>
<li><a href="<?php echo home_url(); ?>/wp-admin/profile.php"><?php _e('Edit profile', 'gitsta'); ?></a></li>
<li class="divider"></li>
<li><a href="<?php echo wp_logout_url('index.php'); ?>"><?php _e('Sign Out', 'gitsta'); ?></a></li>
</ul>
<?php
endif; // End of dropdown for logged users
?>
</div>
</div>
</div>
</nav>
<!-- Anchor for "Back to top"-Link -->
<a name="top"></a>
<?php
if(is_front_page() && (get_gitsta_theme_option('frontpage_blog_descr') == 1)):
?>
<div class="subhead">
<div class="container">
<h3><?php echo bloginfo('description'); ?></h3>
</div>
</div>
<?php
endif;
?>