How Do I Create a Custom Menu in WordPress Mobile?
Creating a custom menu in WordPress Mobile can be a daunting task, but with a few simple steps, it can be done. To start, create a new file named menu.php and add the following code:
‘header’, ‘depth’ => 3, ‘items_per_page’ => 12, ‘primary_item’ => ‘Primary Menu’, ‘sub_menu_item’ => ‘Sub Menu 1′, ‘sub_menu_item_title’ => ‘Sub Menu 1 Title’, ‘sub_menu_item_description’ => ‘Sub Menu 1 Description’, ‘sub_menu_item_icon’ => ‘fa-menu’, ‘menu_icon_size’ => 20, ‘active’ => ‘active’, ‘parent_item’ => ‘Parent Menu’, ‘menu_class’ => ‘menu-item’, ‘show_on_mobile’ => ‘show’, ‘menu_anchor’ => ‘top-menu’, ‘menu_text’ => ‘Menu Text’, ‘show_on_desktop’ => ‘show’, ‘add_to_cart’ => ‘add’, ‘tag’ => ‘menu-item-tag’), );
The first line of code sets the theme location for the menu. The next six lines define the menu’s depth, the number of items per page, the primary and sub menu items, and the sub menu items’ titles, descriptions, and icons.
The last line defines the menu’s active state, its parent item, and the menu class.
To create a custom menu in WordPress Mobile, add a link to the menu.php file from the header of your site.
To make sure the menu appears when users visit your site on a mobile device, use the show attribute to set the menu to active. Finally, add menu text and a menu item tag to help you identify the menu items.