1

When I add a new menu item to the header menu there is an alignment issue (please see the image).

I'm not exactly sure which part of the header.php file to modify to address this problem.

header menu problem

Update - below is the code from my theme header file:

<?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-->
2
  • Please share your menu and logo place code then i will try to help you
    – Trilok
    Aug 1, 2018 at 13:01
  • @Trilok Thank you, I have added the header file code to my post. If you could take a look that would be much appreciated.
    – Arkane55
    Aug 2, 2018 at 0:28

1 Answer 1

0

Please use below code in your header.php file

<?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-->

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.