• relish1227

    (@relish1227)


    Hello,

    This is a great idea! However, I am having trouble getting it to work. I can confirm that my menu code works fine without your custom attributes. But, when I add ‘level’ and ‘child_of’ nothing shows up.

    One potential issue is that I am not sure of the syntax for the integer option for ‘child_of’ — at first I assumed it was the Post ID of the menu item page… but then realized it needed to be the Menu ID. So I inspected the full menu and found the ID and ended up with this:

    	wp_nav_menu( 
    		array( 
    			'container' => '', 
    			'theme_location' => 'menu-main', 
    			'level' => 3,
    			'child_of' => 10455,
    		) 
    	);

    But, that didn’t work, so I tried the menu title:

    	wp_nav_menu( 
    		array( 
    			'container' => '', 
    			'theme_location' => 'menu-main', 
    			'level' => 3,
    			'child_of' => 'On Stage',
    		) 
    	);

    But, that didn’t work either. I’ve tried removing ‘level’ and also changing the value of ‘level’ to 1.

    What am I missing? Thank you.

Viewing 1 replies (of 1 total)
  • Thread Starter relish1227

    (@relish1227)

    Actually, I decided to try it with ‘level’ = 2 and it worked…

    	wp_nav_menu( 
    		array( 
    			'container' => '', 
    			'theme_location' => 'menu-main', 
    			'level' => 2,
    			'child_of' => 'On Stage',
    		) 
    	);

    Why would it have to be 2? I have more levels to display.

    I also am still confused about what integer to use for ‘child_of’. Any help would be appreciated!

Viewing 1 replies (of 1 total)
  • The topic ‘Can’t get it to work?’ is closed to new replies.