Customizr additional menus on different pages
-
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>’ : ” );
}’
- The topic ‘Customizr additional menus on different pages’ is closed to new replies.