WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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() {
  'primary-menu' => __( 'Primary Menu' ),
  'secondary-menu' => __( 'Secondary Menu' ) 
share|improve this question

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

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

Do you see this wordpress.stackexchange.com/a/132155/9884 – Brad Dalton Feb 9 '14 at 13:51

Add a new item to the array like displayed below:

add_action( 'init', 'my_custom_menus' );
  function my_custom_menus() {
        'primary-menu' => __( 'Primary Menu' ),
        'secondary-menu' => __( 'Secondary Menu' ),
        'third-menu' => __( 'Third Menu' )
share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.