Add (grand)child pages automatically to nav menu

It’s wise to avoid nav menus in cases like this where things may change frequently. Instead, you could look into using wp_list_pages() – with a custom walker if you need one to format it visually. Try wp_list_pages() right out of the box first and see whether you can just use CSS to style the list … Read more

Convert complex HTML menu to WordPress [closed]

This is just another normal menu. You can use CSS class in menus to add custom CSS main-menu-item-before-divider for menu item which acts as divider in CSS class field which can be activated under Screen Options tab at the top of Menu page. You can create another custom field for font awesome classes for menus. … Read more

how to add data to li for wp_nav_menu?

You have at least three options, depending on how extensive your demands are: There is a filter towards the end of wp_nav_menu that lets you change the function’s output. If the menu is fixed you could use this to do a simple find and replace on the html-string. This is an easy solution, but if … Read more

enqueue script during add menu items means before save menu items

Because this menu items are appended with ajax response you need to run this JS functions again for each item that you add to the menu with the document#menu-item-added event. Add something like this in your JS file. $(document).on(‘menu-item-added’, function(event, markup) { // debug that the hook work console.log(markup); $.each(markup, function(index, menuItem) { if(menuItem.id) { … Read more