menu Archives - wiki

WordPress get menu array

How to get the wordpress menu array

menu structure

BY SlUG

BY LOCATION

Output

  • If the menu_item_parent equals 0 (false) that manse that menu is a root menu
  • menu_item_parent hold the parent menu id if it is not 0

 

ref: https://codex.wordpress.org/Function_Reference/wp_get_nav_menu_object

https://developer.wordpress.org/reference/functions/wp_get_nav_menu_items/

  Like
By bm on June 22, 2016 | wordpress | A comment?
Tags: ,

WordPress custom menu

How to create WordPress custom menu

Step 1. register_nav_menu()

In functions.php add the following code

I after adding this code the new menu will started showing in admin (Appearance->menu)

wordpress custome menu admin

We can register multiple menus at same time

Step 2. wp_nav_menu()

Call ‘ wp_nav_menu()’ wherever you want to display the newly created menu

I am just adding in footer.php

 

new menu in footer

 

ref: https://codex.wordpress.org/Function_Reference/register_nav_menu

ref : https://codex.wordpress.org/Function_Reference/register_nav_menus

  Like
By bm on | wordpress | A comment?
Tags: ,