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
- What is considered good practice for registering menu locations?
- Connect WordPress with SharePoint [closed]
- Automatically adding new post categories to menu
- Add data attribute to each li in menu
- Reconfiguring WordPress site
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- Move category description below post list in blog
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Remove metabox from WordPress menu editor page?
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- How to add an arrow to menu items has submenus
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- Customizer: active_callback and sanitize_callback incompatibility?
- My page.php shows the index.php
- Unique icons next to each WordPress menu item
- Child page menu in sidebar
- Title Case WordPress Menu Items
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Custom Theme’s “Preview Changes” Doesn’t Work for Previously Published Posts
- Trying to store submenu items to render out after main menu
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- How to change menu order item
- How do I link a button I created in theme customizer to a function?
- 404 error when I acess the second page of post-type
- How to change theme programmatically from a external application?
- Custom Menus: dynamic highlighting problem with custom home link
- get_the_title() gets printed out twice
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Does wordpress templates always in files or in database?
- proper way to add css using functions.php?
- Add item to top of menu using a filter in functions.php
- What does this mean in wordpress? Easy question
- Adding PHP in the menu
- Two menus show up
- Showing latest post without 301 redirect
- Translate wordpress date from Italian to English
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Separation of presentation and code – WordPress
- Register a menu – Error Header
- How to style one item from main navigation?
- Show About and Contact Us page when they’re clicked in the top menu.
- WordPress Customizer Default Image
- New walker for walker_nav_menu to change inside container data
- Add data-id attribute to child page links
- Parsing Menu Items and Blog Posts
- Do I have anything to worry about when switching to a default theme to test for plugin conflictions?
- Add login hyperlink to secondary navigation menu
- Why in my theme I can’t see all the statics content under the posts?
- get_template_directory adding FTP root folders in urls
- How to integrate noimage picture in this code
- Need oop for wordpress theme? [duplicate]
- Automatically add images to a menu
- 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?
- Warning: printf(): Too few arguments in helpers.php file
- Design with Elementor and code the rest?
- Add value to new attribute inside WordPress menu items
- wp_nav_menu not working correctly in my underscores theme
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- WordPress and PHP Version Upgrade issue [closed]
- home.php show blog posts as grid view
- Menu Items fail to save correctly, cause reset of related page metadata
- Dropdown menu for categories
- Menu Custom Data Attributes
- How to display different submenus?
- blank white page when post/update/change option etc
- How to Update an old theme for the latest wordpress version
- Get the name of menu item with wp_nav_menu
- get_comments_number() returns 0
- Notice: Trying to get property of non-object
- Fatal errors to undefined function in theme 404.php file [closed]
- How to use wp_nav_menu to create custom dropdown menu?
- Problems clearing cache
- How to modify mobile nav menu text in theme
- Amend theme php to include certain category in header
- Output only links using wp_nav_menu()
- Get css class of menu item in custom menu structure
- How to add aria role and schema markup to custom walker container
- How can I use custom menus with a Bootstrap WordPress theme?
- Nav menu from plugin to theme
- Override index with a custom PHP page
- Adding Additional Variables on Menus Page
- Implementing custom tag/tax pages
- Extend Menu Walker Output
- Randomize Color Scheme Selection in Theme
- Accidentally deleted php code in WordPress website [closed]
- Nav-Menu not showing up
- Custom navigation menu with awsAccordion
- how to add a div inside wp_page_menu
- ‘Bones’ theme: Load stock scripts in footer instead of header?