If you need this menu on one page only, let’s say About Us (slug: about-us
), you can easily add a conditional like this in pages.php
at the place where you want the menu to appear:
if (is_page('about-us')) {
wp_nav_menu(
array(
'theme_location' => 'secondary-menu',
'menu_class' => 'secondary', 'fallback_cb' => ''
));
}
Remember that if you have a third party theme, you should build a child theme for this page, because else your adaptation will be lost when the theme is updated.
Related Posts:
- Check if a menu is empty?
- How to call a certain object/menubar in a PHP file
- To close or not to close php
- Adding first / last CSS classes to menus
- How does printf( __( ) ); work?
- Return HTML Template Page with PHP Function
- Mega Menu Walker
- start_lvl Ignored in Custom walker_nav_menu
- Why do templates contain so many PHP tag pairs?
- Displaying Logged-In User Name in WordPress Menu
- Hide main div if wp_nav_menu is empty
- Menu Items Disappearing
- Is there a way to parse shortcodes in PHP?
- wp_delete_auto_drafts() deletes links in menus
- Displaying a WooCommerce product via PHP
- What exactly does “Posts page” do in WordPress?
- Static Frontpage Pagination – Custom loop
- Get the php template file from other theme folder
- how to put the logo in the center of other items in the navigation bar
- renaming an admin menu item with decimal array index number
- WordPress Template Engine?
- How can I hook into and edit the text of a wp_nav_menu tag?
- How to remove a metabox from menu editor page?
- How to have a custom display for both woocommerce archive and product-category pages? [closed]
- Walker class: Problems with understanding how walk() method can be called without error
- wp_remote_get returns an error for valid URL
- How to Use the Function is_user_logged_in To Display Different Menus?
- Replacing a specific menu item
- How to show only parents subpages of current page item in vertical menu?
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- On this day PHP code
- How to loop over custom fields in a page template?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How to create different menu’s for not logged in visitors and for logged in members?
- Can we have a php “page” without a WordPress “page”?
- Blank on static home page?
- How to add active class to custom menu using while loop and wp_list_pages
- How can I access the “description” of a menu item?
- removing tags from wp_list_pages() using PHP
- WordPress theme & site not loading after moving files
- How to place login logout link on menu that redirects users back to current page?
- Adjust the results quantity for Search Results page pagination
- wp_delete_auto_drafts() deletes links in menus
- How can I add a class to a single menu item?
- Exclude pages with certain template from wp_list_pages
- Replacing the NavWalker dropdown element
- How to add specific menu on a specific page or pages
- Use Timber/Twig to pull an image by image ID [closed]
- Categories Template Assistance
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- WordPress menu deletes when trying to add a hook
- Is it possible to use the featured image of a page as a css background without inlining?
- Logout and redirect using the WP Menu
- Remove all nav menu classes ( but keep useful ones… )
- Unable to set right time in admin and frontend template
- Easiest way to show total number of subpages
- Switching between custom templates in a post type of the admin menu
- Use template for posts with a particular category grandparent
- Second Navigation inside header
- Creating new menu item
- Programmatically create menu with custom link
- Custom Loop through category menu to include sub categories
- selected menu item
- Blank space at beginning of tag?
- Placing the_content inside shortcode not working
- Link to file in plugin directory from wordpress template?
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- Password protecting content in custom template
- items_wrap not working
- How to override wp-admin styling
- Style wp_page_menu() items
- wp nav menu: add attributes to menu items [duplicate]
- Add a Second Menu to a theme that only support 1 menu
- Custom excerpt function re-factoring
- Inject PHP code into “sidebar-content” – code before my WooCommerce sidebar widget?
- Have CSS Class Added with `is_page()` WP function
- How to display user nickname (not display name) in PHP template?
- Custom Template 404 for specific custom post type
- An unwanted inline style is added to my body tag
- How to properly insert a link to a template in WordPress?
- Custom field value not saving when it contains a URL?
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Run a filter when a walker runs
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- Automatically add custom CSS to new posts using a category template
- Can’t extend some core classes
- Change Navigation Bar based on logged in or not
- Render ninja form inside markup
- Show comments menu in dashboard only if the site has comment
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Count top level menu items
- create a select input with menus created on a custom options page
- How can I load a PHP page without using a Template?
- Multiple WordPress Menus that will only display all pages
- Menu — How to add “current-menu-grand-ancestor” css class
- Input type search in Menu
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- WP Walker using custom css classes
- Change list item content in menu navigation to add a child element with specific class