Add third level menu on wordpress

Add a new item to the array like displayed below: add_action( ‘init’, ‘my_custom_menus’ ); function my_custom_menus() { register_nav_menus( array( ‘primary-menu’ => __( ‘Primary Menu’ ), ‘secondary-menu’ => __( ‘Secondary Menu’ ), ‘third-menu’ => __( ‘Third Menu’ ) )); }

Show subpages of a category in a custom menu

If you created a menu, you would have to drag in those pages, as the basic Walker_Nav_Menu class does not pull subchildren into it. If this is your desired effect, you could created a custom Walker, essentially duplicate the start_el() function of Walker_Nav_Menu, and perform a check on $item->type to see if you are dealing … Read more

Odd spacing in Navigation Bar [closed]

That issues is often encountered when using inline-block on elements. Could be fixed with a good CSS reset when starting the theme (may force you to rewrite lots of css sections) or by making the menu “li” elements display block and float left instead. Check my screenshot how I “fixed” your problem. image link

How to change the menu like this?

You need to create a custom walker. Specifically, create a child class of Walker_Nav_Menu. The only funciton you need to override is start_el(). Copy it wholesale into your class, and place the title where you want it. Then in your wp_nav_menu call, specify your walker. <?php wp_nav_menu( array( ‘link_before’ => ‘<span><strong>’, ‘link_after’ => ‘</strong></span>’, ‘walker’ … Read more

search form leads to 404

Don’t submit directly to search.php. WordPress probably will not know what to do with that. You will have the same issue submitting directly to any theme file. WordPress should pick up on the s parameter and process the search correctly if you just leave out the action attribute like so: <form id=’searchform’ method=’get’> Untested, but … Read more

How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?

I had the same problem. I used Polylang plugin and 3 languages. So i created 3 menus like this: https://www.diigo.com/item/image/4o9rz/opx5. after that i checked the language and displayed the correct menu,like this: <?php if (get_locale() == ‘en_US’) { wp_nav_menu(array( ‘menu’ => ‘Primary Menu En’, ‘depth’ => 2, ‘container’ => false, ‘menu_class’ => ‘nav navbar-nav’, ‘walker’ … Read more

Showing home button in a specified menu

show_home isn’t working for you because there is no show_home argument on wp_nav_menu. You will need to add it using the menu editor in the admin panel, most likely as a custom link. These are the valid arguments: $defaults = array( ‘theme_location’ => ”, ‘menu’ => ”, ‘container’ => ‘div’, ‘container_class’ => ”, ‘container_id’ => … Read more