0

I would like to add a third level menu on WordPress. This is the code I've added to the functions.php file to create the secondary menu, but when trying to repeat the same code with a third menu, I get an error.

add_action( 'init', 'my_custom_menus' );
  function my_custom_menus() {
     register_nav_menus(
        array(
  'primary-menu' => __( 'Primary Menu' ),
  'secondary-menu' => __( 'Secondary Menu' ) 

migrated from stackoverflow.com Feb 4 '14 at 0:13

This question came from our site for professional and enthusiast programmers.

1

Add a new item to the array like displayed below:

add_action( 'init', 'my_custom_menus' );
  function my_custom_menus() {
     register_nav_menus(
        array(
        'primary-menu' => __( 'Primary Menu' ),
        'secondary-menu' => __( 'Secondary Menu' ),
        'third-menu' => __( 'Third Menu' )
        ));
  }
  • Thank you for the answer, I've tried to do so, it's giving me an error. – Ethan31 Feb 3 '14 at 1:36
  • Than you are having problems somewhere else. if you post what's an error maybe you will get more help. Are you sure you are not duplicating function name? – Aleksandar Đorđević Feb 3 '14 at 7:10
  • @Ethan31 What kind of "Error"? Errors have messages, which provide the needed information to help you. – kaiser Feb 9 '14 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy