-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathheader.php
119 lines (114 loc) · 5.17 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
<?php
/**
* 响应式wordpress主题
*
* @package : rebirth
* @Author: Yqchilde
* @link https://yqqy.top
*/
?>
<?php header( 'X-Frame-Options: SAMEORIGIN' ); ?>
<!DOCTYPE html>
<html lang="zh-CN" <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"/>
<title><?php if ( is_home() ) {
bloginfo( 'name' );
echo " - ";
bloginfo( 'description' );
} elseif ( is_category() ) {
single_cat_title();
echo " - ";
bloginfo( 'name' );
} elseif ( is_single() || is_page() ) {
single_post_title();
echo " - ";
bloginfo( 'description' );
} elseif ( is_404() ) {
echo '页面未找到!';
echo " - ";
bloginfo( 'description' );
} else {
wp_title( '', true );
echo " - ";
bloginfo( 'description' );
} ?></title>
<?php
$keywords = wp_keywords();
$description = wp_description();
?>
<meta name="keywords" content="<?php echo $keywords; ?>"/>
<meta name="description" content="<?php echo $description; ?>"/>
<link rel="shortcut icon" href="<?php echo rebirth_option( 'favicon_link' ) ?>"/>
<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="<?php echo home_url(); ?>/">
<?php if (rebirth_option('site_dnsprefetch')) : ?>
<link rel="dns-prefetch" href="<?php echo rebirth_option('site_dnsprefetch') ?>">
<?php endif; ?>
<link rel="dns-prefetch" href="//cdn.jsdelivr.net/">
<link rel="dns-prefetch" href="//hm.baidu.com/">
<link rel="dns-prefetch" href="//zz.bdstatic.com/">
<link rel="dns-prefetch" href="//sp0.baidu.com/">
<link rel="dns-prefetch" href="//api.share.baidu.com/">
<link rel="dns-prefetch" href="//push.zhanzhang.baidu.com/">
<link rel="dns-prefetch" href="//gravatar.loli.net/">
<link rel="dns-prefetch" href="//www.google-analytics.com/">
<?php wp_head(); ?>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@iconfu/[email protected]/dist/svg-inject.min.js"></script>
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>?ver=<?php echo Rebirth_Version ?>" type="text/css" media="screen"/>
</head>
<body class="rebirth-body">
<div class="d-flex site-wrapper">
<div class="d-block d-lg-none d-xl-none sidebar-wrapper">
<?php if (is_404() == false) : ?>
<include><?php get_sidebar(); ?></include>
<?php endif; ?>
</div>
<div class="main-wrapper">
<?php if (is_404() == false) : ?>
<header class="fixed-top shadow-sm main-header scroll-reveal-header">
<nav class="navbar navbar-expand-md header-navbar">
<div class="container">
<a class="navbar-brand" href="<?php echo esc_url( home_url( '/' ) ); ?>">
<span class="d-inline-block align-top navbar-brand-logo">
<?php if ( rebirth_option( 'site_logo' ) ) : ?>
<img id="svg-img" src="<?php echo rebirth_option( 'site_logo' ) ?>" width="30"
height="30" class="d-inline-block align-top navbar-brand-logo"
onload="SVGInject(this)" alt="<?php
echo esc_attr( rebirth_option( 'site_name' ) );
?>">
<?php endif; ?>
</span>
<?php echo esc_attr( rebirth_option( 'site_name' ) ); ?>
</a>
<button class="navbar-toggler sidebar-toggler" type="button" data-toggle="collapse"
aria-controls="sidebar-wrapper" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse">
<?php wp_nav_menu( [
'theme_location' => 'primary',
'menu_class' => 'navbar-nav mr-auto',
'fallback_cb' => false,
'container' => false,
] ) ?>
<div class="ml-auto nav-left">
<button type="button" class="btn site-tooltip btn-nav-left btn-dark-mode click-dark"
data-toggle="tooltip" data-placement="bottom" title="切换风格">
🌓
</button>
<button type="button" class="btn site-tooltip btn-nav-left btn-search click-search"
data-toggle="tooltip" data-placement="bottom" title="搜索文章">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
</nav>
</header>
<?php endif; ?>