Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1381017
    ferdia
    Participant

    Hello,

    I’m having problem adding a top menu to my site.
    I’ve added this to my functions.php file

    // BEGIN SECOND MENU LOCATION
    function register_login_menu() {
    register_nav_menu(‘login-menu’,__( ‘login Menu’ ));
    }
    add_action( ‘init’, ‘register_login_menu’ );
    // END SECOND MENU

    Afterwards i added this code to ../x-child/framework/views integrity/wp-header.php
    <div id=”extra_menu”> <?php wp_nav_menu(array(‘theme_location’ => ‘login-menu’, ‘container_class’ => ‘woo_login_class’)); ?></div>
    <?php x_get_view( ‘global’, ‘_slider-above’ ); ?>

    You can see the results using this link: http://eye-site-testing.com/

    Two things are happening that i don’t onderstand.
    1.The new menu is not displaying in the menu’s locations in the backend.
    2. There is a list of all the pages in the website appearing from this menu.

    Thanks

    #1381150
    Christian
    Moderator

    Hey there,

    Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself. If you have any further questions about the theme, we are more than happy to provide you with assistance on these inquiries.

    Thank you for your understanding.

    #1384089
    ferdia
    Participant

    Thanks Christian for you reply but i got it sorted out.

    For those who would like to add extra menu this is what i done. But before you start i would suggest doing this only on a child theme.

    Add the code below to your functions.php file.

    // BEGIN SECOND MENU LOCATION
    function register_login_menu() {
    register_nav_menu(‘additional-menu’,__( ‘Additional Menu’ ));
    }
    add_action( ‘init’, ‘register_login_menu’ );

    Add this code snippet to your wp-header.php file. Y’ll have to copy this file form your mother theme at /x/framework/views/integrity/wp-header.php to /x-child/framework/views/integrity/wp-header.php.

    <div id=”extra_menu”> <?php wp_nav_menu(array(‘theme_location’ => ‘additional-menu’, ‘container_class’ => ‘woo_menu_class’)); ?></div>
    The code above is added just after ‘<?php x_get_view( ‘global’, ‘_header’ ); ?>’ because i wanted this menu at the top. You may want to place this somewhere else.

    Finally the CSS code for the Menu

    #extra_menu {
    width: 100%;
    height: 40px;
    background: #095D3B;
    padding-right:50px;
    }

    .woo_menu_class {
    display: block;
    float: right;
    margin: 0 auto;
    width: 100%;
    height: 42px;
    }
    .woo_menu_class ul,
    div.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    }

    .woo_menu_class li,
    div.menu li {
    float: right;
    position: relative;
    }

    .woo_menu_class ul ul {
    display: none;
    position: absolute;
    top: 38px;
    left: 0;
    float: right;
    width: 180px;
    z-index: 99999;
    }

    .woo_menu_class a {
    color: #fff;
    text-transform:uppercase;
    font-size:12px;
    display: block;
    line-height: 41px;
    padding: 0 10px;
    text-decoration: none;
    font-weight: normal;
    }

    .woo_menu_class ul li:hover > ul {
    display: block;
    }

    .woo_menu_class li:hover > a,
    .woo_menu_class ul ul :hover > a {
    background: #E0B102;
    color: #fff;
    }

    .woo_menu_class ul ul a {
    background: #ECCE79;
    line-height: 1em;
    padding: 10px;
    width: 160px;
    height: auto;
    }

    .woo_menu_class ul li.current_page_item > a,
    .woo_menu_class ul li.current-menu-ancestor > a,
    .woo_menu_class ul li.current-menu-item > a,
    .woo_menu_class ul li.current-menu-parent > a {
    color: #fff;
    }

    Hope it helps

    #1384212
    Paul R
    Moderator

    Thanks for sharing. Have a great day! 🙂

  • <script> jQuery(function($){ $("#no-reply-1381017 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>