• June 2, 2017

    If you are using the the WordPress Function register_nav_menus() , it should be fairly simple.
    In your functions.php file you’ll need to register 3 separate menu’s, something like this:

    <?php
    add_action( 'init', 'register_my_menus' );
    function register_my_menus() {
      register_nav_menus(
        array( 'first' => 'first', 'second' => 'second', 'third' => 'third', )
        );
      }
    ?>

    With the menu’s now registered you just need to place them where they go in your theme files like so:
    The First Menu (maybe in the header.php file)

    <div id="menu">
      <?php wp_nav_menu( array( 'theme_location' => 'first' ) ); ?>
    </div>

    The Second Menu (maybe in the sidebar.php file)

    <div id="menu">
      <?php wp_nav_menu( array( 'theme_location' => 'second' ) ); ?>
    </div>

    The Third Menu (maybe in the footer.php file)

    <div id="menu">
      <?php wp_nav_menu( array( 'theme_location' => 'third' ) ); ?>
    </div>

    The final step is to go to Appearance>Menu’s and create the 3 menu’s,
    name them and choose the pages that will go with them from within the Admin Menu Settings.



เวอไนน์ไอคอร์ส

ประหยัดเวลากว่า 100 เท่า!






เวอไนน์เว็บไซต์⚡️
สร้างเว็บไซต์ ดูแลเว็บไซต์

Categories