This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Mobile Menu

  • Creator
    Topic
  • #527
    kdaigler
    Participant

    I purchased another of your themes (Swagger) and you had a tutorial on how to add a mobile menu. I’ve tried to do this same method with the Akita theme without success. I registered the mobile menu in the functions.php file of my child theme., and then selected the option for the “Display Simple Select Menu” in the configuration area. The mobile menu location shows up in the menu section and I can select the mobile menu I created, but the main menu for the desktop site still shows up on my mobile device. Any thoughts are appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #528
    Jason Bobich
    Keymaster

    Hello,

    Can you post a link to your site and the code that you’re using to try and do this?

    #549
    kdaigler
    Participant

    Site URL: http://www.derecktor.com
    I’m using the Akita theme.
    Entire code of functions.php is below. This is in my child theme folder.

    <?php
    /*-------------------------------------------------------*/
    /* Run Theme Blvd framework (required)
    /*-------------------------------------------------------*/
    
    require_once ( TEMPLATEPATH . '/framework/themeblvd.php' );
    
    /*-------------------------------------------------------*/
    /* Start Child Theme
    /*-------------------------------------------------------*/
    
    // Start the party ...
    
    // Add stylesheet - Level 4, will get added after EVERYTHING
    themeblvd_add_stylesheet( 'custom_styles', get_stylesheet_directory_uri().'/assets/css/custom.css', 4 );
    
    // Register "Mobile Menu"
    function register_mobile_menu() {
    	register_nav_menus( array( 'mobile-menu' => 'Mobile Menu' ) );
    }
    add_action( 'init', 'register_mobile_menu' );
     
    // Change responsive nav menu id
    function apply_mobile_menu( $menu_id ) {
    	$menu_id = 'mobile-menu'; // Our registered "Mobile Menu" ID
    	return $menu_id;
    }
    add_filter( 'themeblvd_responsive_menu_location', 'apply_mobile_menu' );

    The mobile menu doesn’t contain several items that the main menu has, such as “press Releases,” “Gallery” and “Video” among others. Thanks for your help. Kathy D.

    #556
    Jason Bobich
    Keymaster

    I removed this article because it doesn’t apply in all scenarios, as you’re seeing now.

    Ok, so remove this part:

    // Change responsive nav menu id
    function apply_mobile_menu( $menu_id ) {
    	$menu_id = 'mobile-menu'; // Our registered "Mobile Menu" ID
    	return $menu_id;
    }
    add_filter( 'themeblvd_responsive_menu_location', 'apply_mobile_menu' );

    And replace it with this:

    function my_header_menu() {
    	$menu_style = themeblvd_get_option('menu_style');
    	echo themeblvd_nav_menu_select( 'mobile-menu' );
    	?>
    	
    	<?php
    }
    remove_action( 'themeblvd_header_menu', 'akita_header_menu' );
    add_action( 'themeblvd_header_menu', 'my_header_menu' );

    This is the “akita_header_menu” function copied from /includes/theme-functions.php with the modification of feeding your menu ID “mobile-menu” into the themeblvd_nav_menu_select function.

    #560
    kdaigler
    Participant

    That worked beautifully! Thanks so much.

    Kathy D.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The forum ‘Akita Responsive WordPress Theme’ is closed to new topics and replies.