Skip to content

Instantly share code, notes, and snippets.

@radarin
Last active February 12, 2019 00:06
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 radarin/737537d841200438b72b03f343ce21c2 to your computer and use it in GitHub Desktop.
Save radarin/737537d841200438b72b03f343ce21c2 to your computer and use it in GitHub Desktop.
Neue Menuposition
<?php
// Ein einzelnes Menu registrieren
add_action ('init', 'register_my_menus');
function register_my_menus() {
register_nav_menus(
/* Der erste Wert ist die Theme Location, der Zweite der Name im Backend */
array( 'master-menu' => __( 'Master Menu' ))
);
}
// mehrere Menus registrieren
function register_my_menus() {
register_nav_menus(
array(
'additional-menu' => __( 'Additional Menu' ),
'another-menu' => __( 'Another Menu' ),
'extra-menu' => __( 'Extra Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment