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 trialDavid Soards
18,368 PointsNav Menu not formating Bootstrap 4 WP 4.8.1
My nav is showing up as default Blue links all run together like 1 long word with no padding. Do I need to adjust my settings in the $args array or do I need to change the class or id tags in the bootstrap div? I'm lost please help.
I am using the latest version of Jumbotron with Bootstrap 4.0.0 beta
Here is my header.php code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../../../favicon.ico">
<title>Jumbotron Template for Bootstrap</title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="<?php bloginfo( 'url' ); ?>"><?php bloginfo( 'name' ); ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<?php
$args = array(
'menu' => 'header-menu',
'menu_class' => 'nav navbar-nav',
'container' => 'false'
);
wp_nav_menu( $args );
?>
</div>
</nav>
1 Answer
Jon Speake
3,466 PointsI was also struggling with this, and after hours of research and trying so many different things i eventually got it working following this tutorial https://napitwptech.com/tutorial/wordpress-development/integrate-bootstrap-navbar-4-wordpress-theme/
David Soards
18,368 PointsDavid Soards
18,368 Pointsand here is my functions.php code