Default WordPress menu content

Use the fallback_cb argument of wp_nav_menu(): (callable|bool) If the menu doesn’t exists, a callback function will fire. Default is ‘wp_page_menu’. Set to false for no fallback. <?php wp_nav_menu( array( ‘theme_location’ => ‘main_menu_4’, ‘fallback_cb’ => false ‘depth’ => 1, ) ); ?>

Add custom external link to menu

Backslashes (\) are not usually used in URL addresses, so WordPress tries to fix it to correct URL. I’m almost certain that you should use slashes (/) instead: http://website.co.uk/web1/web2/web3/folder1/folder2/folder3 Then it should all work correctly.

Adding posts to custom menu [closed]

By default you can add posts to menus, so you should be able to see it. There are two reasons, why you don’t see it: Some plugin/theme modified the built-in post type so it can’t be added to menus (I don’t believe anyone would try it). You disabled posts in screen options. Go to Appearance … Read more

Is this format possible with a custom Nav Walker class?

Yes, it is possible… All you need is to write your own Walker class. Here’s a starting point: class My_Custom_Walker_Nav_Menu extends Walker_Nav_Menu { public function start_lvl( &$output, $depth = 0, $args = array() ) { if ( $depth ) { $output .= ‘<aside><a href=”#” class=”custom-class”>Sub Menu Trigger</a><div>’; } } public function end_lvl( &$output, $depth = … Read more

Using a shortcode to create a dropdown menu from wp_nav_menu list items

You can use wp_get_nav_menu_items() which retrieves all menu items of a navigation menu. Your shortcode callback should be something like this . function print_menu_shortcode($atts, $content = null) { extract( shortcode_atts( array( ‘name’ => null, ‘class’ => null ), $atts )); // Assuming $name contains slug or name of menue $menu_items = wp_get_nav_menu_items($name); // Sample Output. … Read more