• Resolved atlantichealthcareproducts

    (@atlantichealthcareproducts)


    I created a mobile menu using the below code and would like to know how to activate it on function.php – Please help.

    // register a mobile menu
    function wdm_register_mobile_menu() {
        add_theme_support( 'nav-menus' );
        register_nav_menus( array('mobile-menu' => __( 'Mobile', 'wdm' )) );
    }
    add_action( 'init', 'wdm_register_mobile_menu' );

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter atlantichealthcareproducts

    (@atlantichealthcareproducts)

    <div class=”mobile-menu” aria-label=”<?php esc_attr_e( ‘Mobile’, ‘blossom-speaker’ ); ?>”>
    <?php
    wp_nav_menu( array(
    ‘theme_location’ => ‘primary’,
    ‘menu_id’ => ‘primary-menu’,
    ‘menu_class’ => ‘menu main-menu-modal’,
    ) );
    ?>
    </div>

    Hi @atlantichealthcareproducts,

    If you make the change directly on the main theme files then on the update all of the changes will be lost. So, you need to create a child theme for the changes.

    You can find many plugins to create a child theme which will also import the parent theme customizer setting to the child theme.

    One of the links to the plugin is – https://www.ads-software.com/plugins/child-theme-configurator/

    You can install and activated the plugin via Dashboard > Plugins > Add New and search for Child Theme Configurator.

    After that, you can add the code in the functions.php file.

    Thank you.

    Thread Starter atlantichealthcareproducts

    (@atlantichealthcareproducts)

    I believe you misunderstood my question.

    I already completed the steps you are proposing.

    My question is! how do I implement the mobile menu to wp_nav area of the blossom speaker function.php

    ALREADY ADDED TO FUNCTION.PHP:
    // register a mobile menu
    function wdm_register_mobile_menu() {
    add_theme_support( ‘nav-menus’ );
    register_nav_menus( array(‘mobile-menu’ => __( ‘Mobile’, ‘wdm’ )) );
    }
    add_action( ‘init’, ‘wdm_register_mobile_menu’ );

    HOW DO I MAKE IT WORK WITH?
    <div class=”mobile-menu” aria-label=”<?php esc_attr_e( ‘Mobile’, ‘blossom-speaker’ ); ?>”>
    <?php
    wp_nav_menu( array(
    ‘theme_location’ => ‘primary’,
    ‘menu_id’ => ‘primary-menu’,
    ‘menu_class’ => ‘menu main-menu-modal’,
    ) );
    ?>
    </div>

    Hi @atlantichealthcareproducts,

    Sorry, we understood you wrong. We thought you were trying to add those codes on the function.php file and we suggested you create the child theme.

    Now, we are not able to understand what are you actually trying to achieve with the additions of those codes?

    Can you please explain what you are trying to do with the help of a screenshot or video? You can use Chrome extension Lightshot to take a screenshot and Loom for recording video(recommended) straight from your browser.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Mobile Menu’ is closed to new replies.