加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
header.php 4.64 KB
一键复制 编辑 原始数据 按行查看 历史
zengxiaoluan 提交于 2017-04-25 15:27 . three line
<!DOCTYPE html>
<html <?php language_attributes();?>>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<?php seo(); wp_head(); ?>
</head>
<body <?php body_class('zengxiaoluan');?>>
<!-- <img id="custom-header" style="display: none;" src="<?php header_image(); ?>" height="<?php //echo get_custom_header()->height; ?>" class="img-responsive" width="<?php //echo get_custom_header()->width; ?>" alt="" /> -->
<div class="container-fluid header-top hidden-print">
<div class="row">
<div class="col-md-6 col-xs-12">
<?php get_search_form(); ?>
</div>
<div class="col-md-6 col-xs-12">
<div class="text-right">
<?php
if ( get_current_blog_id() == 1 ) {
$blog_id = 2;
}else{
$blog_id = 1;
}
?>
<a href="<?php echo get_site_url( $blog_id, '' ); ?>"><?php _e( 'English', 'orange' ); ?></a>
<a href="<?php bloginfo('rss_url'); ?>"><?php _e( '订阅我们', 'orange' ); ?></a>
<a href="javascript: SetHome();"><?php _e( '设为首页', 'orange' ); ?></a>
<a href="javascript: AddFavorite();"><?php _e( '加入收藏', 'orange' ); ?></a>
<?php if ( !is_user_logged_in() ): ?>
<a href="<?php echo wp_login_url();?>"><?php _e( '登录', 'orange' ); ?></a>
<a href="<?php echo wp_registration_url(); ?>"><?php _e( '注册', 'orange' ); ?></a>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="container help-block" id="mobile">
<?php if ( wp_is_mobile() ) {
get_search_form();
} ?>
</div>
<header id="header" class="hidden-print">
<nav id="nav" >
<div class="logo pull-left" id="logo">
<a href="<?php echo esc_url( home_url('/') ); ?>">
<?php
if ( has_custom_logo() ) :
the_custom_logo();
else:
?>
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php bloginfo( 'name' ); ?>">
<?php endif; ?>
</a>
<div id="menu-toggle" class="menu-toggle pull-right">
<span class="line1"></span>
<span class="line2"></span>
<span class="line3"></span>
</div>
</div>
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
'menu_class' => 'primary-menu',
'menu_id' => 'orange-menu',
'container' => 'div',
'container_class'=> 'menu',
'fallback_cb' => false,
'container_id' => 'menu',
'echo' => true,
) );
?>
</nav>
</header>
<style>
.header-top .breadcrumbs{
line-height: 4em;
}
.menu-toggle{
cursor: pointer;
width: 36px;
height: 24px;
position: relative;
}
.menu-toggle span{
position: absolute;
width: 29px;
height: 3px;
background-color: #737373;
display: inline-block;
}
.menu-toggle span.line2{
top: 10px;
}
.menu-toggle span.line3{
top: 20px;
}
.breadcrumbs span[property*='itemListElement']:last-child{
max-width: 375px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
#header.scroll{
position: fixed;
left: 0px;
box-shadow: 0px 1px 15px #d2d0d0,0px -1px 15px #d2d0d0;
}
#header .logo img {
margin-left: 2em;
}
</style>
<script>
jQuery(document).ready(function($) {
setTimeout(function () {
$('#custom-header').slideDown('slow');
}, 1000);
setTimeout(function () {
$('#custom-header').slideUp('slow');
}, 11000)
});
</script>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化