• HI All, I have a website that effectively has 5 additional menus to the main menu. I’ve added the php below for the menus I need, in fucntions.php The menus are registered with WP as they are now showing in the Manage Locations. What I am battling to do is set the locations on specific pages for the additional menus. I have missed something somewhere, as the page is fine until I add the Hooks & the Display Functions? Any help would be appreciated.
    `// Additional menus
    add_action( ‘init’, ‘register_extra_menus’ );
    function register_extra_menus() {
    if ( function_exists( ‘register_nav_menus’ ) ) {
    register_nav_menus( array(
    ‘solar_menu’ => ‘Solar Menu’,
    ‘aircon_menu’ => ‘Aircon Menu’,
    ‘electrical_menu’ => ‘Electrical Menu’,
    ‘lighting_menu’ => ‘Lighting Menu’,
    ‘energy_menu’ => ‘Energy Menu’
    ) );
    }
    }

    // Hook display functions for each of them on theme elements:
    add_action(‘__before_header’, ‘display_solar_menu’);
    add_action(‘__before_header’, ‘display_aircon_menu’);
    add_action(‘__before_header’, ‘display_electrical_menu’);
    add_action(‘__before_header’, ‘display_lighting_menu’);
    add_action(‘__before_header’, ‘display_energy_menu’);

    // Display functions:
    function display_solar_menu() {
    echo ( has_nav_menu( ‘solar_menu’ ) ? wp_nav_menu (
    if ( is_page( array(
    ‘Solar Power’, ‘Commercial Solar Power Systems’, ‘Solar Schools’, ‘Testimonials’,
    ‘Solar Hot Water’, ‘Solar Rebates & Incentives’, ‘Stand Alone Solar Power’, ‘The Solar Power Installation Process’, ‘Grid Connect Solar Power’, ‘SAE Group Solar Products’, ‘Our Solar Panels’, ‘Luxen Solar Panels’, ‘Renasola Solar Panels’, ‘Seraphim Solar Panels’, ‘WINAICO Solar Panels’, ‘Our Solar Inverters’, ‘Solar Maintenance’, ‘Maintenance Booking Form’
    )
    ).'<div class=”clearall”></div>’ : ” );
    }’

Viewing 1 replies (of 1 total)
  • Thread Starter Leapmkt12

    (@leapmkt12)

    Ok 7 menu created with locations, I have tried to set the locations on specific pages for the additional menus. I am testing with the first page template by removing the main customizr menu and replacing it with the menu selected for the template page, but it is not pulling through?

    ‘// Remove customizr main menu
    remove_action ( ‘__navbar’ , array( $this , ‘tc_menu_display’ ), 30, 1);
    // display function for your menu:
    function display_solar_menu() {
    if ( tc__f( ‘__Solar_Page’ ) ) {
    echo ( has_nav_menu( ‘solar-menu’ ) ? wp_nav_menu (
    array (
    ‘theme_location’ => ‘solar-menu’,
    ‘container_id’ => ‘solar-menu’,
    ‘container_class’ => ‘solar-menu’
    )
    ).” : ” );
    }
    }
    // Hook display functions for each of them on theme elements:
    add_action(‘__before_header’, ‘display_Solar_Menu’);
    ?>’

    I have tried this both on my child theme functions.php as well as the solar-page template with the new Customizr 3.4.6 version. The new page template has been copied from the custom-page.php file.
    Any help would be appreciated!

Viewing 1 replies (of 1 total)
  • The topic ‘Customizr additional menus on different pages’ is closed to new replies.