I’m using the North theme for my site, or rather a minimally-altered child theme of it. Aside from css changes, the main reason for using a child is that I want a different menu in non-home pages.
I’ve already changed header.php to load the “secondary-menu” on every page other than home, altered functions.php to add the new menu, and WordPress’ dashboard seems to recognise the location properly. Even the theme customiser has no trouble identifying it and, on paper, everything seems to work ok.
On the actual site, however, instead of loading the menu I have assigned, it loads the list of pages instead. I know I am missing something painfully obvious, but I have no idea what.
Any help will be appreciated.
<?php if(is_page('home')) { wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); } else { wp_nav_menu( array( 'theme_location' => 'secondary', 'menu_id' => 'secondary-menu' ) ); }?>
Hi Στέργιος,
Would it be possible for you to send me a copy of the child theme so I can run a few tests? If so, Please upload an archived version to a 3rd party file hosting site such as teknik.io.
To clarify, is there a specific reason why you’re using is_page() over is_front_page()?
I will upload as soon as I get back home. It’s just the three files right now, so it shouldn’t take too long. As for why I didn’t use is_front_page() …simply didn’t think of it. Changed it now, though it did not affect the issue I’m having.