当我向标题菜单添加新菜单项时,存在对齐问题(请参见图片)。
我不确定标题的哪一部分。要修改以解决此问题的php文件。
更新-下面是我的主题头文件中的代码:
<?php
global $gaming;
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Streamer</title>
<!-- fav icon -->
<?php if($gaming[\'site_favicon_upload\'][\'url\']!=""){?>
<link rel="icon" href="<?php echo $gaming[\'site_favicon_upload\'][\'url\'];?>"
sizes="16x16">
<?php }?>
<?php wp_head();?>
</head>
<body <?php body_class();?>>
<div class="wrapper">
<header class="header">
<div class="header-main">
<div class="container">
<div class="col-md-3 col-sm-3 col-xs-12">
<form action="<?php echo esc_url( home_url( \'/\' ) ); ?>" method="get">
<input type="text" name="s" id="search" value="<?php
the_search_query(); ?>" />
<input type="submit" placeholder="">
</form>
</div><!--col-md-3 col-sm-3 col-xs-12-->
<div class="col-md-6 col-sm-6 col-xs-12">
<nav class="nav">
<?php
wp_nav_menu( array(
\'theme_location\' => \'nav\',
\'menu_class\' => \'\',
\'container\' => \'ul\',
\'container_class\' => \'\',
\'container_id\' => \'\',
) );
?>
</nav><!--nav-->
<div class="logo">
<a href="<?php echo esc_url( home_url( \'/\' ) ); ?>"><img src="<?php echo $gaming[\'site_logo_upload\'][\'url\'];?>" alt=""></a>
</div><!--logo-->
</div><!--col-md-6 col-sm-3 col-xs-12-->
<div class="col-md-3 col-sm-3 col-xs-12 header-right">
<a href="<?php echo $gaming[\'btn_url\'];?>" class="btn">JOIN US NOW</a>
</div><!--col-md-3 col-sm-3 col-xs-12-->
</div><!--container-->
</div><!--header-main-->
</header><!--header-->
SO网友:Trilok
请在标题中使用以下代码。php文件
<?php
global $gaming;
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Streamer</title>
<!-- fav icon -->
<?php if($gaming[\'site_favicon_upload\'][\'url\']!=""){?>
<link rel="icon" href="<?php echo $gaming[\'site_favicon_upload\'][\'url\'];?>"
sizes="16x16">
<?php }?>
<?php wp_head();?>
</head>
<body <?php body_class();?>>
<script>
jQuery(document).ready(function(){
jQuery(".nav ul > li:nth-child(2)").after(\'<div class="logo" ><a href="<?php echo esc_url( home_url( \'/\' ) ); ?>"><img src="<?php echo $gaming[\'site_logo_upload\'][\'url\'];?>" alt=""></a></div>\');
});
</script>
<div class="wrapper">
<header class="header">
<div class="header-main">
<div class="container">
<div class="col-md-3 col-sm-3 col-xs-12">
<form action="<?php echo esc_url( home_url( \'/\' ) ); ?>" method="get">
<input type="text" name="s" id="search" value="<?php
the_search_query(); ?>" />
<input type="submit" placeholder="">
</form>
</div><!--col-md-3 col-sm-3 col-xs-12-->
<div class="col-md-6 col-sm-6 col-xs-12">
<nav class="nav">
<?php
wp_nav_menu( array(
\'theme_location\' => \'nav\',
\'menu_class\' => \'\',
\'container\' => \'ul\',
\'container_class\' => \'\',
\'container_id\' => \'\',
) );
?>
</nav><!--nav-->
</div><!--col-md-6 col-sm-3 col-xs-12-->
<div class="col-md-3 col-sm-3 col-xs-12 header-right">
<a href="<?php echo $gaming[\'btn_url\'];?>" class="btn">JOIN US NOW</a>
</div><!--col-md-3 col-sm-3 col-xs-12-->
</div><!--container-->
</div><!--header-main-->
</header><!--header-->