I am trying to customize my pre bought theme. What i try is, to have different menus for each page without using a plugin. Original theme has a function about navigation which uses walker class. here is the file in the original.entrepreneur theme. http://pastebin.com/TeT8hi7z.

I use Entrepreneur Child Theme. I want to use primary navigation in home page and turkish navigation in turkish flag. I added functions.php and I added the code below:

if (is_page('AOE Home')){
    wp_nav_menu(array('menu'=>'Primary Navigation' ));
    } elseif (is_page('turkish')) {
        echo "text";
    wp_nav_menu(array('menu'=>'Turkish Navigation' ));
}

But navigation elements stays same. Can you help me to solve my problem?

Thanks

up vote 1 down vote accepted

Try with adding this code into header.php, where menu usually appears. In functions.php you can declare custom menus, but you are calling them in header.php or wherever you want menus to appear.

Function register_nav_menus() declares menus and should go into functions.php, while wp_nav_menu() outputs menus you declared anywhere on the page (so not inside functions.php).

  • I will try that solution; but site has stuck. – ytsejam Oct 15 '15 at 20:02
  • What do you mean? – Bruno Kos Oct 15 '15 at 20:17
  • Site was not opening. I tried it but still no solution. Your answer makes logic. But I am too tired to try more. Tomorrow I'll let you know . – ytsejam Oct 15 '15 at 20:19
  • With some debugging you will get there, now that you know how should it go :) – Bruno Kos Oct 15 '15 at 20:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.