Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMargaret Godowns
6,268 PointsWhere does sub-menu styling come from?
I think I'm missing a step here. How does Wordpress know how to style the sub-menu elements? I know we pass the 'no-bullet' class to the ul in the $defaults array, but we don't ever assign a 'sub-menu' class to the sub-menu ul. However, I see that a 'sub-menu' class is present in the markup when I inspect element. Is this something that Wordpess does automatically? Do we just need to include styling for the 'sub-menu' class in our stylesheets?
1 Answer
Jacob Arriola
12,805 PointsHey Margaret,
You are correct, the .sub-menu
class comes automatically from WordPress and you'll just need to include styling for it in your stylesheet. Keep in mind that if you have a third-level of menu items, the .sub-menu
class will appear again, as it naturally appears for all sub menus of navigation items built with the wp_nav_menu()
function. Hope this helps!