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?– TheDeadMedicFeb 25, 2016 at 15:26
-
I want bring menu function from plugin to theme and use it.– VladFeb 26, 2016 at 11:09
1 Answer
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.
-
-
What do you mean by this? What "plugin directory" are you referring to?– RyanFeb 26, 2016 at 23:39