Hooks for Modern Theme Navigation

Forums Forums SwiftThemes Support Hooks for Modern Theme Navigation

This topic contains 3 replies, has 2 voices, and was last updated by  John P 7 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34619

    John P
    Participant

    I am using the Modern theme and would like to hook in a member-profile button after navigation or before the search bar.

    I cannot figure out the hooks to add in my function.

    I tried:
    add_action(‘swift_after_branding’,’member_access’,30);

    and it displays after logo & before nav.

    swift_before_main places it entirely outside the nav row.

    What is the hook to place it post-navigation?

    If more than modifying functions.php required, please tell me what to add to the child theme so I can do this.

    Thank you, Satish!

    #34621

    Satish Gandham
    Keymaster

    Hi John,
    Use this hook
    add_action('swift_header', 'swift_nav_below_logo', 22);
    It will add your content after search box.

    #34624

    John P
    Participant

    I tried this and the results were:
    <nav id=”below-logo” class=”hybrid navigation clearfix” role=”navigation”>
    <div id=”branding-container”>
    <div id=”branding” class=”clearfix hybrid”>
    <div class=”div-content clearfix”>
    <h1 id=”logo-wrapper”></h1>
    </div></div>
    <!– /branding –>
    </div>
    <ul ><li >Menu</ li></ ul>
    <form> Search box code </form>
    </nav>
    </div>
    **MY_TEXT_FROM_FUNCTION**
    </header>

    I am desiring the text from my function to be wrapped in BEFORE the </nav>, or even better, after the closing </ ul> of the Menu.
    How do I do this?

    • This reply was modified 7 months, 1 week ago by  John P.
    #34626

    John P
    Participant

    Since Satish never responded, here is how I fixed it on my own…

    in the Modern template functions.php
    search for register_nav_menu and insert these two lines just after the two existing actions:

    register_nav_menu('bonus-menu', __('Bonus menu in header', 'swift'));
    register_nav_menu('bonus-menu-tablets', __('Bonus menu in header for tablets'));

    then search for function swift_modern_nav_below_logo()

    in that function, look for the closing < /ul>
    Create a new line above that and insert the following code:

    <?php
    		    if($swift_design_options['enable_responsive'] && $swift_is_mobile->isTablet()){
            $nav2 = "bonus-menu-tablets";
        }else{
            $nav2 = "bonus-menu";
        }?>
    		<?php wp_nav_menu(array('theme_location' => $nav2, 'container' => false, 'menu_class' => '', 'items_wrap' => '<li id="" class="%2$s">%3$s', )); ?>
    
    • This reply was modified 7 months, 1 week ago by  John P.
    • This reply was modified 7 months, 1 week ago by  John P.
    • This reply was modified 7 months, 1 week ago by  John P.
    • This reply was modified 7 months, 1 week ago by  John P.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.