0

I would to take nav menu reference (I have id and class) from plugin to theme header.php...How can I do this? I used something like this<?php wp_nav_menu('id'); ?> but of course with failure cause I didn't specific from where I pick this menu...How can I do?

  • Can you explain a little more? – TheDeadMedic Feb 25 '16 at 15:26
  • I want bring menu function from plugin to theme and use it. – Vlad Feb 26 '16 at 11:09
1

wp_nav_menu() doesn't accept a single value for a parameter, it takes an array. Proper format (if you are looking to simply call the menu by ID) would look like this:

wp_nav_menu(
    array(
        'menu' => $menu_id
    )
);

I'd recommend checking out the full reference in the codex for more information on the available parameters for displaying a menu.

  • Will it recognize menu from plugin directory? – Vlad Feb 26 '16 at 11:10
  • What do you mean by this? What "plugin directory" are you referring to? – Ryan Feb 26 '16 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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