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 trial

WordPress

Dennis de Vries
Dennis de Vries
9,440 Points

How style a custom menu with css?

So I've just learned to add custom menu's to wherever I like in the site, using the 'register_nav_menus' function and adding the 'wp_nav_menu' to any part of the site.

Cool! This adds a pretty boring old unordered list to, in the case of this video, the footer of the template. Now I'm wondering, how would one go about and style this. How do you give this custom menu an id, so you can edit the css of that particular menu?

In the previous video Zac does show how to style a custom widget area and I followed those instructions on the custom menu, but that did not work. Any other ideas?

Thanks!

1 Answer

Daniel Lucas
Daniel Lucas
3,604 Points

If you inspect the menu, they should already have classes, and ID's for you to style.

Right Click > Inspect Element

Dennis de Vries
Dennis de Vries
9,440 Points

It does indeed, thnx.

Follow up question: Is it possible to add a class or id to the menu through php (similar as with widget area's)?