title: Change static nav menu to wordpress dynamic menu
body: <p>I'm trying to convert my static nav menu to WP dynamic nav.</p>
  
  <p>This is what I've got:</p>
  
  <pre><code>     &lt;nav&gt;
           &lt;ul id="menu"&gt;
  
              &lt;?php 
  
  
                  $pages = array( 'index.php' =&gt; 'Home', 'services.php' =&gt; 'Services', 'sitemap.php' =&gt; 'Calculators', 'about.php' =&gt; 'About'
                  , 'contact.php' =&gt; 'Contact' );
  
                  $query = $_SERVER['PHP_SELF'];
                      $path = pathinfo( $query );
                      $selected = $path['basename'];
  
                  foreach( $pages as $url =&gt; $title ) {
                     $li = '&lt;li ';
                     if( $url === 'index.php' ) {
                         $li .= 'class="alpha"';
                     } else if ( $url === 'contact.php' ){
                         $li .= 'class="omega"';
                     }
  
                     if( $selected == $url ) {
                         $li .= 'id="menu_active"';
                     }
                     $li .= '&gt;&lt;a href="' . $url . '"&gt;&lt;span&gt;&lt;span&gt;' . $title . '&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;';
                     echo $li;
                  }
              ?&gt;
  
          &lt;/ul&gt;
      &lt;/nav&gt;
  </code></pre>
  
  <p>But I've read that I need to use this?</p>
  
  <pre><code>                    &lt;?php wp_nav_menu( array( 
                          'theme_location' =&gt; 'primary',
                          'container' =&gt; false,
                          'menu_class' =&gt; 'menu'
                      ) ); ?&gt;
  </code></pre>
  
  <p>I really don't get it nor how to implement this? Any ideas? I really am stuck with this so help is much needed and appreciated. Thanks.</p>