Mobile Menu not changed with per-page navigation

This topic has 8 replies, 4 voices, and was last updated 9 years ago ago by Stan Russell

  • Avatar: hackdotcom
    hackdotcom
    Participant
    April 8, 2015 at 19:27

    Selecting a custom menu to be used in the page header on a per-page basis does not change the mobile menu used.

    7 Answers
    Avatar: Robert Hall
    Robert Hall
    Support staff
    April 8, 2015 at 19:29

    Hello,

    Please navigate to Dashboard->Appearance->Menu and select Mobile Menu also. Please see screenshot: http://prntscr.com/6r9lww

    Regards,
    Robert Hall.

    Avatar: hackdotcom
    hackdotcom
    Participant
    April 8, 2015 at 19:33

    Hi Robert,

    Totally get how to set a mobile menu. My problem is that the “Custom navigation for this page” does not change the mobile menu for this page.

    The setting replaces the header menu, but does nothing to modify the mobile menu shown.

    Looking at the functions used, it seems like a filter/conditional has been left out of the mobile menu display function that determines if the custom menu option is in use. This filter/conditional is in place in your original header menu function.

    I’d really rather not write the code to make this happen, seems like a missed step on your development checklist.

    Avatar: hackdotcom
    hackdotcom
    Participant
    April 8, 2015 at 19:37

    On a slightly different note, the “custom logo for this page” does not replace the sticky header logo either. What can we do about this?

    Avatar: bgirer
    bgirer
    Participant
    April 8, 2015 at 19:47

    I’m having this problem as well. I understand how to set a mobile menu and how to set per-page custom navigation menus, but I don’t see a way to change the mobile menu on a per-page basis. It looks like there is only an option for a universal mobile menu.

    Intuitively, setting a custom navigation menu on a page should also change that page’s mobile menu.

    Avatar: hackdotcom
    hackdotcom
    Participant
    April 8, 2015 at 20:09

    Well, as I wait for solutions from the developer:

    Found a way to display the custom page logo on the fixed header bar.

    Header.php – Line 65:

    Change etheme_logo(true);
    to etheme_logo(false);

    Not sure why this option is built in or deployed with the theme as default true (meaning to avoid the fixed header menu).

    Avatar: hackdotcom
    hackdotcom
    Participant
    April 8, 2015 at 20:35

    Not in the best of moods regarding this theme.

    I made a modification to the mobile navigation theme function and can see why this was avoided by the theme developer.

    The mobile menu was never built to be used as a one page navigation. There was no testing done on this point. Using anchor tags in the menu does not function at all. The menu stays open, the link doesn’t activate or slide the page content.

    100% an unfinished piece of functionality.

    Below is the modified function that will display the custom menu in the mobile navigation spot. Place in functions.php and it will override the main function in theme-functions.php

    function et_get_mobile_menu($menu_id = 'mobile-menu') {
    
        if ( has_nav_menu( $menu_id ) ) {
            $custom_menu = etheme_get_custom_field('custom_nav');
            $output = wp_cache_get( $menu_id, 'et_get_mobile_menu' );
            $one_page_menu = '';
            if(etheme_get_custom_field('one_page')) $one_page_menu = ' one-page-menu';
    
            if(!empty($custom_menu) && $custom_menu != '') {
                $output = false;
                $output = wp_cache_get( $custom_menu, 'et_get_main_menu' );
                if ( !$output ) {
                    ob_start();
    
                    wp_nav_menu(array(
                        'menu' => $custom_menu,
                        'container_class' => $one_page_menu,
                        'walker' => new Et_Navigation_Mobile
                    ));
    
                    $output = ob_get_contents();
                    ob_end_clean();
    
                    wp_cache_add( $custom_menu, $output, 'et_get_main_menu' );
                }
    
                echo $output;
                return;
            }
            if ( !$output ) {
                ob_start();
    
                wp_nav_menu(array(
                    'container_class' => $one_page_menu,
                    'theme_location' => 'mobile-menu',
                    'walker' => new Et_Navigation_Mobile
                ));
    
                $output = ob_get_contents();
                ob_end_clean();
    
                wp_cache_add( $menu_id, $output, 'et_get_mobile_menu' );
            }
    
            echo $output;
        } else {
            ?>
            <br>
            <h4 class="a-center">Set your main menu in <em>Appearance > Menus</em></h4>
        <?php
        }
    }
    Avatar: stan
    Stan Russell
    Participant
    April 9, 2015 at 18:32

    Hello,

    By default fixed header logo uses one certain image for all pages in our theme. ‘Additional logo’ option has been added recently in response for some users request to have inverse logo for transparent header types.
    That’s why auto using of custom logo for fixed header is disabled in the theme code. We will discuss the idea of additional option for adding fixed header logo for every page. If this feature is approved – we will implement it.

    Your notice regarding the custom navigation and using it for mobile version is wellgrounded and surely will be taken into account and fixed in the next theme version.

    Regards,
    Stan Russell.

  • Viewing 8 results - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.