The Starkers theme setup is hooked to after_setup_theme
, at a priority of 10
. So you basically have to wrap the unregister function inside another function (child themes functions.php file) and add it later than the parent themes setup function, so it gets first added by the parent and later on removed by the child.
function wpse_remove_parent_theme_locations()
{
// @link http://codex.wordpress.org/Function_Reference/unregister_nav_menu
unregister_nav_menu( 'primary' );
}
add_action( 'after_setup_theme', 'wpse_remove_parent_theme_locations', 20 );
Related Posts:
- Dynamically exclude menu items from wp_nav_menu
- Add custom menu item using wp_nav_menu_items filter
- Custom search filter causes menu and query_posts problems
- Allow html tags in WordPress Custom Menus Description Field
- Using filters to change href of nav menu page link
- How to apply a class to the second word in menu list item?
- WordPress nav_menu_link_attributes Not Working
- Is it possible to add a filter for the output of nav-menu items in admin?
- if role is logged in then do something
- Filter menu item to add classes/attributes?
- Edit html for menu items in default frontend menu
- Set Item Order with wp_nav_menu_{$menu->slug}_items
- When at / ( or “home”) my menu doesn’t get a current-menu-item class
- How to add parent element’s title to nav menu’s child?
- Why is ‘nav_menu_item_args’ filter’s $item argument empty?
- Add class to active element and its parent in nav menu
- display only the wp_nav_menu, which has the current-menu-item
- Removing strip_tags not working on nav_menu_description
- Third level navigation class
- How to add #navbar to all page links?
- add span to top level links of a wordpress menu called “main”
- Debugging – trying to add search box to menus
- wp_list_pages() but only show children on the branch you are on
- From a page, is it possible to find entry’s “menu_item_parent”?
- Add active class to top-level menu items when viewing single for that post type
- add_filter on menu items to add a menu item
- how to disable default menu classes
- Insert other menus as submenus of a main menu
- list category posts under its item in menu
- Prevent menu from loading in a page template [duplicate]
- Insert a div before the wp_nav_menu
- How to change menu structure?
- Secondary Navigation Menudisappeared When using wp_nav_menu_items
- remove specific classes from menu items
- wp_nav_menu action/filter help
- add_filter for where statment issue
- Add a counter beside menu item label
- Add custom link on the fly to nav menu
- menu-item class missing on wordpress menu
- Filter to hook into menu items and add a custom attribute
- if role is logged in then do something
- Possible to append class to nav menu added to widget area?
- Build a one-page navigation within a non-one-page ttheme…
- Modifying Woocommerce menu based on tags and categories
- Why does WordPress convert absolute URLs to relative URLs for menu items?
- Menu location switcher – example code fails
- Add Featured Image and Title to wp_nav_menu items
- Show thumbnail to category items in wp_nav_menu(), how?
- Add Class to Custom Menu Widget ul
- Avoid changing menu query with suppress_filters => false
- Change “login/register” to “useraccount” when a user has logged in
- Removing menu item doesn’t get removed on edit post
- Add Protocol to Custom Menus
- How to modify menu text in callback function of ‘walker_nav_menu_start_el’ hook
- Why is WordPress stripping anchor links from mneu item URLs?
- Add button and title on submenu WordPress
- Customizing Only a Specific Menu using the “wp_nav_menu_items” Hook?
- How Does The Walker Class Work?
- How to highlight the right item in the navbar
- Minor css-change based on topmenu – how?
- Add class to all list items of wp_nav_menu
- Merge two separate WP menus into one in Mobile view
- How to add a parameter to links in the nav menu?
- Current menu item
- How to quickly create a dummy menu?
- Altering html structure and creating custom menus
- How to construct a custom html for submenus
- JSON file export of nav menu
- Generating wordpress menu – cant understand the config
- Display menu locations in all sites of a multi site
- Making a navigation header menu with bulma, need some advice
- How to retrieve parent menu item name of current submenu item
- Main menu gets replaced when second menu is created
- Avoid user registrations with specific email provider
- Hide menu items if the page content is empty
- exclude pages in custom menu
- How to reference argument data for wp_nav_menu() from functions.php
- Showing the same menu in multiple location
- wp_nav_menu with WP as pure CMS
- Simple form to add custom links to menu?
- Making the menu toggled open on mobile devices Illustratr theme
- How to include second layer sub menu to Walker Nav?
- need help in wordpress navbar setup
- How can I creat custom menu with bootstrap
- Restrict user to edit only edit a certain menu
- Getting parent object_id of child menu items in WordPress menu
- How to remove a sub-menu using walker hooks/filters without relying on a custom walker?
- Calling wordpress menu outside ignores custom menu item
- Specific Page that convert Hyperlink to anchor in nav menu
- How can I make this custom design menu work in wordpress?
- Active menu item / category
- Add different span class to wp nav menu
- Help with changing style of the extended menu drop down [closed]
- How we show pages in dropdown
- wp_nav_menu doesn’t show on index page
- Elegant way of adding an CTA to a menu
- How to set menu Display location
- How to add custom menu to block theme?
- get menu name for the current displayed page
- How to add a class directly on a unordered list element that is a primary navigation