Wordpress - Unregister Nav Menu from Child-Theme
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 );