Skip to content

Instantly share code, notes, and snippets.

@webdados
Created March 19, 2024 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/4b1cfc9ae06ac5754e9bb124f7ec9dba to your computer and use it in GitHub Desktop.
Save webdados/4b1cfc9ae06ac5754e9bb124f7ec9dba to your computer and use it in GitHub Desktop.
How to create classic menu locations on WordPress
<?php
/**
* Register menu locations - Put this on your (child-)theme functions.php file or use a code snippets plugin
*/
add_action( 'after_setup_theme', function() {
register_nav_menus(
array(
// One line per location
'top_menu' => 'Top menu',
'footer_menu' => 'Footer menu',
'legal_menu' => 'Legal menu',
)
);
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment