On my website I have two menus - one on the top and the second which appears after scrolling down.

The order of menu items is correct in "scrolling-menu", and in the "top-menu" it's reversed.

What did I wrong?

  <div id="scrolling-menu">
      <div  class="container">
          <div class="row">
              <div class="col-md-2 col-md-offset-1"><img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/img/logo.png" class="img-responsive" /></div>
              <div class="col-md-8 col-md-offset-1">
                  <?php wp_nav_menu( array( 'theme_location' => 'header-menu', 'depth' => 1)); ?>

          <div class="container">
                <div id="logo"></div>
                <div id="mainnav">
                        <?php wp_nav_menu( array( 'theme_location' => 'header-menu', 'depth' => 1)); ?>

At first both menus were working correctly but then I realised that I forgot to install the menu in functions.php. The problem started after adding the file but after deleting it the problem remains.

My functions.php file looked like that (it's deleted now):

    function register_my_menus() {
    array( 'header-menu' => __( 'Header Menu' ))
    add_action( 'init', 'register_my_menus' );

The menu that is reversed is because it is float:right;. That's the expected behavior when you use float:right;.

This has nothing to do with WordPress itself it is a purely CSS issue.

  • No way! I had no idea. Thank you very much, now it works just fine! But, anyway, it's strange that the problem appeared after I added functions.php. Maybe I have some code issue. Thank you!:)
    – Dandy
    May 8 '15 at 14:33

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.