title: How do you add bootstrap cdn to a wordpress theme?
body: <p>I am very new to wordpress development and I tried adding bootstrap through the function.php file. I get the bootstrap styles but some of the things like the dropdown and the the expanding hamburger menu are not working. Can someone explain what I am doing wrong?</p>
  
  <p>This is my functions.php file:</p>
  
  <pre><code>&lt;?php
  
  
      add_action('wp_enqueue_scripts' , 'vault_files');
  
      function vault_files(){
  
        wp_enqueue_style('vault_main_style', get_stylesheet_uri()); 
  
        wp_enqueue_style( 'bootstrap-css', 'https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css');
  
        wp_enqueue_script('bootstrap-js', 'https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js');
      }
  
  
  
  ?&gt;
  </code></pre>
  
  <p>my header.php file looks like this:</p>
  
  <pre><code>&lt;!doctype html&gt;
  
  
  &lt;head&gt;
      &lt;!--the following function lets wordpress be in control of the head section
      this is prevent our theme from breaking when we add other plugins. --&gt;
      &lt;?php wp_head(); ?&gt;
  &lt;/head&gt;
  
  
  &lt;body&gt;
  &lt;header class="site-header"&gt;
      &lt;!-- Required meta tags --&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"&gt;
  
  
  
      &lt;!--google fonts--&gt;
      &lt;link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One|Patua+One&amp;display=swap" rel="stylesheet"&gt;
  
  
      &lt;!--navbar starts here--&gt;
      &lt;nav class="navbar navbar-expand-lg navbar-light bg-light"&gt;
    &lt;a class="navbar-brand" href="#"&gt;Navbar&lt;/a&gt;
    &lt;button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"&gt;
      &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
    &lt;/button&gt;
  
    &lt;div class="collapse navbar-collapse" id="navbarSupportedContent"&gt;
      &lt;ul class="navbar-nav mr-auto"&gt;
        &lt;li class="nav-item active"&gt;
          &lt;a class="nav-link" href="#"&gt;Home &lt;span class="sr-only"&gt;(current)&lt;/span&gt;&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link" href="#"&gt;Link&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item dropdown"&gt;
          &lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
            Dropdown
          &lt;/a&gt;
          &lt;div class="dropdown-menu" aria-labelledby="navbarDropdown"&gt;
            &lt;a class="dropdown-item" href="#"&gt;Action&lt;/a&gt;
            &lt;a class="dropdown-item" href="#"&gt;Another action&lt;/a&gt;
            &lt;div class="dropdown-divider"&gt;&lt;/div&gt;
            &lt;a class="dropdown-item" href="#"&gt;Something else here&lt;/a&gt;
          &lt;/div&gt;
        &lt;/li&gt;
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link disabled" href="#"&gt;Disabled&lt;/a&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
      &lt;form class="form-inline my-2 my-lg-0"&gt;
        &lt;input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search"&gt;
        &lt;button class="btn btn-outline-success my-2 my-sm-0" type="submit"&gt;Search&lt;/button&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/nav&gt;
    &lt;/header&gt;
  </code></pre>