wp_nav_menu
takes an optional argument called menu
, which will fetch any menu by name, slug or ID.
If you just want post objects (or anything but the menu HTML), wp_get_nav_menus
is the way to go. Otherwise, use wp_nav_menu
. If you need it to return the menu HTML instead of echoing, there’s an argument for that as well: echo
.
Related Posts:
- How to call “page specific menu items” in template [closed]
- Include Max mega menu Plugin into theme
- Redirect to another page using contact form 7? [closed]
- How can I add different menus (different style menu) on each page?
- How can I keep a WordPress dropdown menu open when navigating to a child page?
- Creating a nav menu
- All of my custom posttypes are 404’ing
- Display post lists in 2nd paragraph
- Easiest way to add dropdown to a page
- How to get the element ID from new menu list that added with add_filter()?
- wp_get_post_terms is difference obj model than the one in rest api response
- how to add a button next to the wordpress view button?
- Merging Two menus in the backend into one menu
- Classified ad website : which solutions to use? [closed]
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Best place for short bio,image and button [closed]
- What are the specifics of WordPress development I need to know? [closed]
- WordPress shows error related to allow_url_fopen
- Delete mobile menu button [closed]
- html generated by theme exist but doesnt appear in browser
- How to create a code editor for my plugin .?
- How to show only next post pagination link using wp_link_pages()
- Changing page URL and connect newsletter to MailChip
- Finding the URL to be used to check if plugin is installed with a theme
- Dynamic admin submenu
- Center and hide overflow of WP toolbar custom links
- Js file is not adding using this code in functions.php
- wp_footer hook only working on homepage not in other pages
- How to remove admin main menu name repetition
- How can I position ShareThis buttons manually when using the plug-in? [closed]
- Custom Permalink Plugin and Current Page/Ancestor in Menus
- wp-custom-menu filter removes the current_page_item class
- add_action does not call the function
- Plugin can not display in my custom theme
- How to use my menu PHP code as sidebar?
- How to use get_template part in the plugin?
- Jquery NoConflict Problem
- Overriding Parent Theme… will cause plugins failure?
- WordPress premium theme development [duplicate]
- How do I combine a theme with a plugin
- how to force tag page layout to use same as search layout?
- How can I show a different theme for admin users? WP 3.8+
- Great blogs site resources/tutorial for WordPress Developers? [closed]
- How to show the number of website visitors in my theme
- How to write “alt” tag in image for wordpress code?
- Hide a Menu Item on Login
- How to get menu location in wp_update_nav_menu hook
- multiple language website navigation menu suggestion
- PHP script from functions php is loaded via admin-ajax to div…and the result is 0, not the desired content
- How to multiply a post to test internal search results?
- Use different single.php file based on condition
- Customizing Titles on the Fly with Code
- Add SideBar/Widgets Just Below the Post
- Add filter on html tags,attributes on specific function in wordpress
- plugins not working in custom theme
- Release the plugin in the WordPress repository where redux is used
- Progmatically adding menu links to the default (Top) or Footer menu
- Shortcode Attributes to Return different $_POST
- What form should the $query media query array have for an Elementor page builder function? [closed]
- How can I support plugins in a custom theme?
- How to use the CSS of the WordPress core in the development of my administration page?
- Redeclare function after plugin activation
- is_rtl returns false while it should return true
- Include Minit plugin in theme [closed]
- Woocommerce singe product custom gallery output works just on the first slide
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- What is the purpose of a companion plugin
- Remove Pagination for Product Category Pages WooCommerce
- Managing wordpress Themes & plugins for multisite
- How can I use my custom wordpress theme on two websites? [closed]
- Set up functions to be overridden without using function_exists() by short-circuiting them?
- Widget for specific category
- why need theme,if page builder is there in wordpress [closed]
- WordPress custom post type image in RSS
- Add user meta after a user has registered and logged In [closed]
- Visual Composer: Where do I find the source code of a custom element?
- How to customize this theme? [closed]
- Changing the Organize Series Listing Pages
- Changing location of “About me” section
- Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
- Need to revert to an older version of wordpress
- WordPress Custom Menu Admin helper plugin
- WordPress API functions not working at AJAX functions.php call
- What’s the right way to implement functions in footer.php
- How can I add a fixed vertical menu to my site? [closed]
- 2 wordpress site same database
- Don’t load the theme for a page FROM a plugin EDITED
- Hook on creating a menu entry?
- Extending a theme: build new features as plugin or core modules?
- Hardcode a form in Contact Form 7 [closed]
- Remember the Meta Value With Radio Buttons
- how to design change in woocommerce cart page and all other page also by theme? [closed]
- display unique post per category
- How do you create a re-useable HTML fragment in wordpress
- WordPress plugin with its own “site”/theme
- Override methods in Yoast SEO breadcrumb class
- Theme Functions run a function upon activation or preview
- Polldaddy doesn’t show up on own theme
- Dropdown menu on click change
- How to add an admin alert for missing plugins