It doesn’t sound like you need another Navigation menu.
How about something like this:
<?php if ( is_page() && $post->post_parent > 0 ) {
// we know we are on a sub/child page now...
// PS. another way to handle this would be to check if you were on a particular page template or particular page ids etc.
?>
<a class="awesome-button" href="https://wordpress.stackexchange.com/questions/332869/<?php echo esc_url( home_url("https://wordpress.stackexchange.com/" ) ); ?>">Go home!</a>
<?php
// just show a link Home for the subpages...
} else {
// now we are NOT on a subpage, so show the Primary nav menu...
wp_nav_menu( array('menu' => 'primary') );
} ?>
Related Posts:
- Programmatically add a Navigation menu and menu items
- Dynamically exclude menu items from wp_nav_menu
- Show current navigation path from menu
- Call custom field into menu item
- Exclude Private, Draft pages from Primary Nav when using custom menu
- wp_nav_menu always falls back to a menu
- wp_get_nav_menu_items how to exclude sub level menu items?
- Add custom attributes to menu items without plugin
- Add Page ID class to nav menu items
- Not able to get current menu ID
- Add class to active top level (grandparent) menu item
- how to automatically generate hierarchical menus from hierarchy of pages?
- Why is ‘nav_menu_item_args’ filter’s $item argument empty?
- WordPress wp_nav_menu with a nav tag
- Add sidebars to navigation menu?
- `start_el` depth argument in custom nav walker always evaluates to zero
- Use walker for specific menu, or avoid use of walker
- Change where navigation bar links?
- Programmatically set current-menu-item using wp_nav_menu
- How to insert custom code into wp_nav_menu structure?
- Remove li from wp_nav_menu
- Adding post excerpt into navigation menu
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- Adding Custom “Current Menu Item” class to navigation?
- How to fix “Supplied nav_menu_item value missing property” after update to WordPress 5.0
- Check if menu id = $specific_id – then insert specific
- I am facing a problem with the navigation menu of my website
- Prepend to start of WordPress nav loop
- Change an li class name in a wordpress custom menu walker
- Separator for custom nav menu
- You do not have permission to create Navigation Menus – Twenty Twenty-Two theme
- Creating a navigation menu to see where you are on your website
- current-menu-item class is not added
- Automatically list top level menu item child pages
- Nav and logo loading each time causing menu to move JointsWP – Foundation 6
- Check if menu_item has children or has parent
- wp_page_menu not working right?
- Using _s theme, menu changes do not affect header menu
- How to get rid of the home link in nav menu?
- Add span in top menu item with nested itens
- Is it possible to add a dynamic link in the main navigation in a child theme
- display menu as table layout
- Show children (sub-navigation) of active menu item only
- Menu Arrow for Child Element
- Adding an external link to wordpress menu
- How to make wordpress nav menu use post custom meta data
- Add a counter beside menu item label
- set certain item in nav walker to active when on archive pages or singles
- add another html tag after li element in wp_nav_menu
- The cart, checkout, and shop links not getting removed
- Twenty Fifteen: Change navigation menu behavior
- Switch an entire nav menu if user is logged in
- Display Menu Navigation Label
- Menu is not displaying on the site navigation [closed]
- Odd spacing in Navigation Bar [closed]
- wp_list_pages Hierarchical Help
- How to avoid the and which added when custon menu widget is used
- Add pages content to startpage through custom menu
- How to add a menu that belongs to parent blog to all child-blogs?
- Updated WordPress, now Navigation is Messed Up
- How to change how WordPress renders navigation menu on Block Themes
- Problem with links once in portfolio item
- Possible to append class to nav menu added to widget area?
- url_to_postid method in walker_nav navigation menu causing exceptionally high TTFB
- Add Different Class on Different Ul in twenty-twentyone theme
- Get Each Menu Nav Label of Menus in HTML tag
- Is it all right to put the whole tag into template_part file?
- wp_nav_menu container style args
- Misleading behaviour on Menu & Theme location
- How can I click the parent menu then redirect to a special URL?
- How do I display menu in header without loosing styles?
- Adding additional html to the end of the root level in a custom nav walker
- Navbar is hidden behind carousel when using wp-boostrap-navwalker
- Navigation bar is on live site but nothing under menu so can’t add in a page
- Building a menu from a large number of pages?
- Show thumbnail to category items in wp_nav_menu(), how?
- Add data-track to links in menu
- How to select particular menu position in wordpress?
- Links in new menu don’t work
- Conditional Nav Menu Inside Nav Menu Across Multisite Sites
- Is it possible to seperate wordpress menu by different div?
- How to add odd and even classes to all nav links through walker?
- Output sort number in wp menu list item?
- Check in walker if current page is descendant
- Active page link not getting class assigned
- Add dynamic content block to nav section generated by custom walker
- Next/previous a-like single navigation
- Customize Walker_nav_menu to show posts if item is category
- How to output the menue structured for tabbed navigation?
- Replace Menu Item with Logged in username
- Walker for menus
- WordPress Navigation
- Show All Children of WordPress Menu
- Navigation list not correctly styled on pages with custom template (missing .current-menu-item)
- How to make an anchored page in a navigation menu tab
- How was this menu system created?
- Display sub menus as separate lists
- how can i get the page_ID in nav li [closed]
- How do i add logo in wordpress studiopress (glam theme)?
- Two Homes In Navigation Menu