0 Star 0 Fork 0

user_5289163/Class4ever Theme

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
header.php 19.43 KB
一键复制 编辑 原始数据 按行查看 历史
ricky1986 提交于 2020-05-21 22:35 . style
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
<?php
/**获取客户端IP */
function getIp()
{
if ($_SERVER["HTTP_CLIENT_IP"] && strcasecmp($_SERVER["HTTP_CLIENT_IP"], "unknown")) {
$ip = $_SERVER["HTTP_CLIENT_IP"];
} else {
if ($_SERVER["HTTP_X_FORWARDED_FOR"] && strcasecmp($_SERVER["HTTP_X_FORWARDED_FOR"], "unknown")) {
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} else {
if ($_SERVER["REMOTE_ADDR"] && strcasecmp($_SERVER["REMOTE_ADDR"], "unknown")) {
$ip = $_SERVER["REMOTE_ADDR"];
} else {
if (
isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp(
$_SERVER['REMOTE_ADDR'],
"unknown"
)
) {
$ip = $_SERVER['REMOTE_ADDR'];
} else {
$ip = "unknown";
}
}
}
}
return ($ip);
}
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><?php is_front_page() ? bloginfo('description') : wp_title(''); ?> - <?php bloginfo('name'); ?></title>
<?php wp_head(); ?>
<!-- highlight风格 -->
<link rel="stylesheet" href="//static.class4ever.com/highlight.js/v9.18.1/style/ricky.css">
<link rel="stylesheet" href="//static.class4ever.com/layui/v2.5.5/css/layui.css">
<script src="//static.class4ever.com/layui/v2.5.5/layui.all.js"></script>
<!--/highlight风格 -->
<style>
html,
body {
font-family: Helvetica, Arial, Sans-Serif;
font-size: 18px;
color: #fff;
background: #000;
margin: 0px;
padding: 0px;
}
a {
color: #eee;
}
#wrapper {
width: 1015px;
margin: 10px auto;
box-shadow: 0px 0px 10px #666;
overflow: hidden;
}
#head {
height: 40px;
background: #262626;
}
.side-bar {
width: 444px;
}
/**诗句样式 */
.wp-block-verse {
font-size: 21px;
line-height: 40px;
border: 0;
}
.side-bar ul {
line-height: 26px;
}
/* 日历样式 */
#wp-calendar {
background: #000;
color: #ddd;
display: none;
}
#wp-calendar td {
font-size: 19px;
}
.wrap img {
border-radius: 5px;
}
#wp-calendar a {
color: yellow;
}
#wp-calendar a:hover {
color: #fff;
}
#wp-calendar tr:hover {
background: #000;
}
#wp-calendar th {
background: #000;
}
#wp-calendar caption {
background: #333;
padding: 6px;
border: 1px solid #fff;
border-bottom: 0;
}
/* 日历样式 */
.side-bar a {
text-decoration: underline;
white-space: nowrap;
}
#head a {
color: #FFF;
}
#head ul {
padding-left: 20px;
list-style: none;
}
#head ul li {
display: inline;
margin-right: 10px;
}
#head .side {
font-size: 14px;
color: #FFF;
padding-right: 10px;
}
#head .side .custom-logo {
float: left;
margin: 2px 7px 0 0;
border: 0px;
width: 48px;
height: 48px;
}
#head .side .contact-menu,
#head .side .contact-menu li {
display: inline;
margin: 0;
padding: 0;
position: static;
}
textarea {
width: 95%;
}
#head .side .text {
margin-top: 2px;
}
#head .side .text .name {
font-size: 24px;
margin-bottom: 5px;
}
#wrap {
position: relative;
/*background: #6889AE;*/
background: #000;
}
.main {
font-size: 18px;
}
#body {
width: 720px;
min-height: 800px;
background: #000;
color: rgb(220, 220, 220);
padding: 10px 0;
line-height: 1.3em;
}
#body .wrap {
/* margin: 0 20px 20px 20px; */
/* padding: 8px 0 10px 0; */
position: relative;
padding-left: 10px;
}
#body h2 {
margin: 0;
padding: 0;
line-height: 35px;
font-size: 30px;
font-weight: normal;
}
#body h2 span {
font-weight: bold;
}
#body .date {
margin: 10px 0 0 10px;
padding: 0;
color: #6A6A6A;
font-weight: normal;
font-size: 24px;
}
#body div.projects {
float: left;
width: 360px;
margin-right: 15px;
}
#body .rest {
padding: 0 5px 0 5px;
overflow: hidden;
}
#body .rest .bsap {
margin-bottom: 15px;
}
pre {
overflow: auto;
background-color: #000;
margin: 0 15px;
padding: 15px;
font-size: 13px;
line-height: 1.1em;
font-family: Consolas, monospace;
border: 1px solid #DDD;
}
ol.projects,
ol.posts {
list-style: none;
margin: 0;
padding: 0;
}
ol.projects li {
width: 45%;
}
ol.projects p {
margin-top: 5px;
font-size: 0.8em;
color: #444;
}
ol.posts li {
margin: 10px 0;
font-size: 0.8em;
color: #444;
}
ol.posts strong {
font-size: 1.2em;
}
h3 {
margin: 0;
padding: 0;
font-weight: normal;
}
.item {
position: relative;
font-size: 18px;
}
.item img {
position: absolute;
top: 0px;
left: 10px;
display: none;
}
.item .box {
margin: 20px 0 20px 10px;
height: 213px;
width: 560px;
overflow: hidden;
position: relative;
}
.item .box h2 {
margin: 4px 0 5px 10px;
padding: 0;
font-size: 30px;
font-weight: normal;
}
h2 a {
color: #000;
}
.item .box .more {
position: absolute;
top: 4px;
right: 10px;
font-size: 14px;
}
.item .box ol {
list-style: none;
margin: 0 10px 0 10px;
padding: 0px;
height: 150px;
overflow: hidden;
}
.item .box li {
margin: 0 2px 0 0;
padding: 0;
}
.item .box li.blog {
margin-bottom: 8px;
line-height: 18px;
}
.item .box li.blog a {
font-weight: bold;
}
.item .box li.blog .desc {
display: inline;
font-size: 16px;
}
.item .box li.link .desc {
display: none;
}
#side {
position: absolute;
top: 0px;
left: 726px;
color: #FFF;
}
#side h3 {
font-size: 20px;
font-weight: normal;
margin: 20px 0 0 0;
padding: 0;
}
#side h3 span {
font-weight: bold;
}
#side a {
color: #FFF;
}
#body h2 a {
color: rgb(220, 220, 220);
}
#side .box {
width: 268px;
background: #446E95;
position: relative;
padding: 8px;
margin: 15px 0;
overflow: auto;
font-size: 12px;
}
#side .box label {
font-size: 18px;
}
#side .box img {
float: left;
border: 0;
}
#side .box .desc {
margin: 0 0 0 82px;
}
#side .box .padding {
margin: 0 8px;
}
#side .box h3 {
font-size: 18px;
font-weight: normal;
margin: 0 0 5px 0;
padding: 0;
}
#side .box .desc p {
line-height: 18px;
font-size: 14px;
margin: 0;
padding: 0;
}
.more {
text-align: right;
font-size: 18px;
}
.header-img {
width: 960px;
margin-left: -140px;
}
.header-caption {
width: 960px;
margin-left: -140px;
text-align: right;
font-size: 0.6em;
color: #666;
margin-top: -18px;
}
.header-caption a {
margin-right: 20px;
}
@media screen and (max-width: 960px) {
.header-img,
.header-caption {
width: 100%;
margin-left: 0;
}
}
/*@media screen and (max-width: 1015px) {*/
#wrapper {
width: 100%;
margin: 0px;
min-width: 600px;
}
#head.other .side {
right: -95px;
}
#side {
position: static;
width: 100%;
max-width: 720px;
left: 0px;
overflow: hidden;
/* margin: 0 auto; */
background: #6889AE;
}
#side #projects {
width: 608px;
margin: 0 auto;
}
#side .box {
float: left;
margin: 10px;
}
#side br {
clear: both;
}
#head .wrap,
#body {
width: 720px;
/* margin: 0 auto; */
position: relative;
height: 100%;
}
#side .bsap {
float: left;
margin: 10px;
}
/**标签云 */
.widget_tag_cloud a {
font-weight: 700;
margin-right: 0.5rem;
white-space: nowrap;
}
/**归档 */
.widget_archive a {
font-weight: 700;
text-decoration: none !important;
}
/*}*/
@media screen and (max-width: 719px) {
#wrapper {
min-width: 0;
}
#head .wrap {
width: 100%;
}
#head.other .side {
right: 0;
width: 68px;
}
#head .side .text {
display: none;
}
#body {
width: 100%;
}
#body div.projects {
width: 100%;
margin-bottom: 20px;
}
#body .box.large {
width: 100%;
}
#body .rest {
width: 100%;
}
#body img {
max-width: 100%;
}
#side .box {
float: none;
margin: 10px auto;
}
#side #projects {
width: 100%;
margin: 0;
}
}
@media screen and (max-width: 399px) {
#head ul {
position: static;
padding: 8px 0 0 0;
margin: 0 68px 0 10px;
}
#head ul li {
margin-right: 0;
}
#head.other .side {
width: 58px;
}
}
.incanvas a {
text-decoration: underline;
}
.syntax_hilite {
font-family: Courier New;
padding: 8px;
margin: 8px;
background: #F5F5F5;
border-top: 1px solid #BBB;
border-bottom: 1px solid #BBB;
font-size: 14px;
}
.postentry h3 {
font-weight: bold;
}
.postentry blockquote {
padding-left: 5px;
border-left: 3px solid #BBB;
}
.syntax_hilite ol {
list-style: none;
margin: 0px;
padding: 0px;
}
#commentlist {
list-style: none;
margin: 0;
padding: 0;
}
#commentlist li {
font-size: 13px;
margin: 0 0 10px 0;
}
#commentlist li.author {
background: #FFECC7;
}
#commentlist li h3 {
background: #F5F5F5;
border-bottom: 1px solid #BBB;
padding: 4px;
}
#commentlist li div.comment-text {
padding: 10px;
overflow: auto;
}
#commentlist li div.comment-text p {
margin: 0;
padding: 4px 0;
}
#commentform {
border: 1px solid #BBB;
margin-left: 20px;
margin-right: 20px;
background: #000;
padding: 5px;
margin-top: 50px;
}
#commentform h4 {
margin: 0;
}
code {
white-space: pre;
}
code br {
display: none;
}
#carbonads {
margin-top: -12px;
}
.carbon-img img {
margin-right: 8px;
}
.carbon-poweredby {
display: block;
margin-top: 1em;
}
/* 以上是原john的css */
.card {
color: #fff;
border: 1px solid #444;
border-radius: 4px;
margin: 10px;
height: auto;
}
.card>div:not(:last-child) {
border-bottom: 1px solid #444;
}
.card-header {
padding: 10px 10px 5px 10px;
}
.card-body {
padding: .4em 1em .7em;
}
.card-footer {
padding: 5px;
}
.post-title {
font-size: 1.5em;
margin-bottom: 5px;
line-height: 1.5em;
}
.post-title>a {
text-decoration: none;
}
.post-title>a:hover {
text-decoration: underline;
}
.wrap,
#body,
#wrap {
width: 100%;
}
.post-list {
display: flex;
flex-flow: row wrap;
}
.a-post {
width: 422px;
}
.nav-bar {
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.body {
margin-top: 40px;
}
.nav {
display: inline-block;
}
.layui-btn-sm {
font-size: 14px;
}
.card img {
max-width: 100%;
}
</style>
<script src="//static.class4ever.com/jquery/jquery-3.4.1.min.js"></script>
<?php
//判断wordpress是否已登录
$hasLogin = current_user_can('level_0') ? 1 : 0;
?>
<script>
//已登录时调整nav高度
$(document).ready(function() {
const hasLogin = <?= $hasLogin ?>;
const addNum = 30
if (hasLogin) {
//微调nav高度
let topNav = parseInt($('.nav-bar').css('margin-top')) + 30
$('.nav-bar').css('margin-top', topNav + 'px')
}
})
</script>
</head>
<body <?php body_class(); ?>>
<div id="wrapper">
<!-- 导航 -->
<div id="head" class="nav-bar">
<!-- 全站菜单 -->
<div style="white-space:nowrap;">
<?php wp_nav_menu(array(
'theme_location' => 'header-menu',
'container_class' => 'nav',
'depth' => 1
)); ?>
<div style="display:inline-block;">
<form method="get" action="https://blog.class4ever.com/">
<input type="text" name="s" class="layui-input" style="width:150px;display:inline-block;height:30px;">
<button class="layui-btn layui-btn-normal layui-btn-sm">搜博客</button>
</form>
</div>
<div style="display:inline-block;font-size:14px;color:#ddd;margin-left:20px;">
您的ip: <?= getIp() ?>
</div>
</div>
<!-- /全站菜单 -->
<!-- 右侧 -->
<div class="side">
<?php
if (function_exists('the_custom_logo')) {
echo '<a href="/about/" class="logo">';
the_custom_logo();
echo '</a>';
}
?>
<div class="text">
<div class="name" style="display:inline-block;margin-right:5px;"><?php bloginfo('name'); ?></div>
<a href="https://gitee.com/ricky1986/" target="_blank">
<img src="//www.class4ever.com/_static/images/gitee.png" style="width:30px;margin-bottom:13px;" title="码云">
</a>
<a href="https://github.com/ricky1986/" target="_blank">
<img src="//www.class4ever.com/_static/images/github.png" style="width:30px;margin-bottom:13px;" title="GitHub">
</a>
<!-- 公众号 -->
<i class="layui-icon wechat menu-icon" style="font-size:26px;" title="微信公众号">&#xe677;</i>
<!-- /公众号 -->
<div>
<style>
.menu-icon:hover {
cursor: pointer;
}
</style>
</div>
</div>
</div>
<!-- /右侧 -->
</div>
<script>
/**功能: 微信弹出 开始 */
$('.wechat').click(function() {
let html = ''
html += '<div style="text-align:center;margin-top:20px;margin-bottom:40px;color:#000;">基督徒公众号</div>'
html += '<div style="text-align:center;">'
html += '<img src="//www.class4ever.com/_static/images/wechat_mp.jpg" style="width:200px;" alt="基督徒">'
html += "</div>"
layer.open({
type: 1,
shadeClose: true,
maxmin: false,
title: false,
skin: 'layui-layer-rim', //加上边框
area: ['560px', '355px'], //宽高
content: html,
});
})
/***功能: 微信弹出 结束 */
</script>
<!-- /导航 -->
<div id="wrap" class="body">
<div id="body">
<div class="wrap">
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/ricky1986/wp-class4ever-theme.git
git@gitee.com:ricky1986/wp-class4ever-theme.git
ricky1986
wp-class4ever-theme
Class4ever Theme
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385