Adding additional html to the end of the root level in a custom nav walker

Hope this code will helpful for you, add the items_wrap in wp_nav_menu to merge li’s <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘container’ => ”, ‘menu_id’ => ”, ‘menu_class’=> ”, ‘items_wrap’ => ‘<ul id=”%1$s” class=”%2$s”>%3$s<li><a href=”http://www.example.com/contact”>Contact</a></li><li><a href=”javascript:void(0);”>Search</a></li></ul>’ ) ); ?>

How to create a Child & Siblings menu for a custom post type?

OK, I think I have cracked it. The below code seems to work well. To be able to use a custom post type I added an argument into the $args array’post_type’ => ‘product’, Is the below OK? <div id=”sub-pages”> <?php global $post; $args = array( ‘post_type’ => ‘product’, ‘child_of’ => get_top_ancestor_id(), ‘title_li’ => ” ); … Read more

WordPress nav_menu items from another menu appearing

I am sure you went down this path already, but be sure register menus and support for theme: register_nav_menus( array( ‘Main’ => ‘Main Navigation’, ‘Secondary’ => ‘Secondary Menu’ ) ); And then follow your pattern of ‘theme_location’ => ‘Secondary’ to print your registered menu back.

is_tax() conditional tag not working

I found the solution to this, the is_tax(); method needs two arguments – the taxonomy and the term itself, so it should have been: is_tax(‘news_categories’, ‘web’) Just as an extra point the is_archive(‘sites’) should also have been is_post_type_archive(‘sites’)

How to add all subcategories as submenu in WordPress menu

For menus this large, it’s usually more efficient to use functions like wp_list_categories() (which can also output custom taxonomies like Product Categories) in whatever theme template you need to affect. Bonus: your menu will always be current, because unlike a static WP Nav Menu, this will always pull all Product Categories and not need manual … Read more