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 trialjustinpetersen
2,234 PointsHow to float the main menu right?
Normally in Bootstrap I can just add navbar-right to the source code but I can't figure out where the ul tag is in the html code because Wordpress is dynamic. Can someone help me? Here's what the tag looks like when I inspect it <ul id="menu-primary-menu" class="nav navbar-nav">.
2 Answers
mathisvester
13,451 PointsThe navigation markup is usually specified in the header.php of your theme. According to Wordpress function wp_nav_menu() you are able to add an array of nav menu arguments. Within these arguments you can set a menu_class which controls the class names of the unordered list element. At this point you should add the navbar-right class.
Brian Jensen
Treehouse StaffWithout seeing the full code I can't be 100% sure, but try adding this to your custom css file.
#menu-primary-menu {
float: right;
}
Jacob Mishkin
23,118 PointsJacob Mishkin
23,118 Pointsmathisvester is correct, and to add. In the wp_nav_menu() function if you are using bootstrap add the correct bootstrap classes to the nav menu and then you should have a working bootstrap nav.