theme-location
should be theme_location
Check documentation wp_nav_menu
corrected code
wp_nav_menu( array(
'container' => 'ul',
'menu_class' => 'mainNav',
'theme_location' => 'Pages'
) );
wp_nav_menu( array(
'theme_location' => 'Categories'
) );
Related Posts:
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- Why in this WordPress theme I can’t see the Main Menu?
- Editing existing pre-created menus in PHP
- WordPress menu links with images & class selection
- Mega Menu Walker
- start_lvl Ignored in Custom walker_nav_menu
- Menu Items Disappearing
- wp_delete_auto_drafts() deletes links in menus
- Check if a menu is empty?
- Walker class: Problems with understanding how walk() method can be called without error
- How to Use the Function is_user_logged_in To Display Different Menus?
- Replacing a specific menu item
- Activate different theme for temporary preview
- How can I access the “description” of a menu item?
- Design view breaking on Pages
- Passing array in add_option()
- Create a quick start wordpress installation [closed]
- How should I best target dynamically served content?
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- items_wrap not working
- Style wp_page_menu() items
- Have CSS Class Added with `is_page()` WP function
- Run a filter when a walker runs
- Input type search in Menu
- WP Walker using custom css classes
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Change list item content in menu navigation to add a child element with specific class
- Show full posts in archive
- Customizer: active_callback and sanitize_callback incompatibility?
- Child page menu in sidebar
- Title Case WordPress Menu Items
- Trying to store submenu items to render out after main menu
- How to change menu order item
- get_the_title() gets printed out twice
- What does this mean in wordpress? Easy question
- Two menus show up
- Show About and Contact Us page when they’re clicked in the top menu.
- WordPress Customizer Default Image
- Parsing Menu Items and Blog Posts
- Do I have anything to worry about when switching to a default theme to test for plugin conflictions?
- How to add the sidebar to all the pages except the home page? [closed]
- Header not properly displaying on archive.php
- Save Custom CSS file in the upload folder dynamically?
- home.php show blog posts as grid view
- How to display different submenus?
- Get css class of menu item in custom menu structure
- Override index with a custom PHP page
- Randomize Color Scheme Selection in Theme
- Accidentally deleted php code in WordPress website [closed]
- Show login greeting above sub-menu links?
- Why can’t I add a custom image in my navigation?
- Commas in Tag Cloud
- Remove the Tag from wp_nav_menu
- Menu not styling. New menus functionality giving me a headache
- Is there a (offical) way for a theme to deactivate itself and show a message in admin?
- How to put search bar & logo in the “primary navigation” storefront theme?
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- I am having issue in divi woocomerce checkout module. (DIVI theme)
- Adding an Anchor Link to a wordpress menu using WPBakery Page Builder
- Providin exception to WordPress wp_nav_menu Custom CSS Classes
- Styling a category link
- Adding markup to sub menu based on class
- Not able to remove caption shortcode from the content
- File from parent theme imported to child theme doesn’t work – any ideas?
- How to put 2 php codes in functions.php without site crashing
- Conditional Banners
- Menu not updating for logged in users after redirect
- Invalid Argument foreach
- wp_get_nav_menu_items() with ACF
- How to switch between two primary menus (programatically0
- Used a code to revoke some dashboard menus for my contributors but for some reason it’s revoked me access to the editor [closed]
- How to give custom roles the capability to edit one Menu instead of every Menu
- Primary navigation menu with timed items from custom post type
- Add parent menu item in sub-menu in custom nav_walker
- loop to return tags in woocommerce in alphabetical order?
- need to edit php file of child theme to remove an element
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- How limit the width of a fixed menu-bar on scroll?
- Rotating Header Images
- wp nav menu without label
- Contact form field in wordpress menu
- How to call a certain object/menubar in a PHP file
- Sidebar current menu item for parent
- Remove all nav menu classes except those which begin with certain letters
- How to add a code for lastpostdate after/inside a specific menu link?
- Image not displayed
- Add the “.current-menu-item” class to tag?
- WordPress adding in site URL to header links
- How to change the menu color
- Can’t remove menu items added by plugin
- Nav Menu Display
- Adding a unique class to wp_nav_menu
- .htaccess on multisite and roots theme?
- Move wordpress sidebar on homepage up to new position
- Catchable fatal error in appcloud free theme by Tokokoo
- How to create and add js and css file when server is not on my PC?
- Remove Unused Menu Locations
- Need help with Deprecated: Non-static error when update PHP 7.4 -> 8.1 with Dyad 2 theme
- Custom nav with bootstrap dropdown