Drop-down menu help
-
Hi. I am trying to create a drop-down menu but the submenus just appear to the right of the parent menu rather than dropping down. This is my first website, http://www.peacebewithus.com. My theme is pretty obscure. White-Xmas. It supports custom menus but maybe not drop-downs? If not, is there a way to add that functionality? Thanks for any help.
JB
-
This should help: https://www.youtube.com/watch?v=w2g99I_m-KQ
Thanks Questas but still no luck. From what I understand, I must use child pages of the parent page I wish to drop down from. If you look at my page, Boas Noticias is a child page of Good News and its sub-menu but it still appears to the right. Is it possible my theme does not support drop-downs?
Thanks again,
JBIn the menu setup, the Boas Noticias is below Good News. Slide the Boas Noticias one notch to the right. It is shown in the video. Then it becomes a sub of Good News.
I hope that makes sense.In your Dashboard > Appearance > Menu
Current Menu:
GOOD NEWS
BOAS NOTICIASHere is what you want to see:
GOOD NEWS
….BOAS NOTICIAS(ignore the …. just used for spacing here)
Hmm. Not sure what you are seeing because it is definitely slid to the right here. It even says “sub-item” and I have hit save menu a few times so I dunno.
Oy,
JBIt seems to be a theme issue.
https://ww.wp.xz.cn/support/theme/white-xmasThis is a deliberate decision by your theme’s author. Instead of implementing dropdown menus, the author has chosen instead to display all menu items in a long list, as you’re seeing on your site.
You could change this in a child theme by copying
header.phpfrom your parent theme’s folder to the child theme’s folder and then changing line 33 from<?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => -1, 'menu_id' => 'menu-container',) ); ?>to
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'menu-container',) ); ?>You would then have to code in the dropdowns with some CSS. This should be enough to at least get you started:
@media screen and (min-width: 601px) { .main-navigation li { position: relative; } .main-navigation ul ul { display: none; position: absolute; top: auto; } .main-navigation li:hover > ul { display: block; } }Ah ok. Do you think it’s a bug in the theme? Not sure but I was under the assumption that Custom Menu support included drop-downs.
Wow. Thanks Steven. That did the trick.
The topic ‘Drop-down menu help’ is closed to new replies.