title: Change selected drop down option depending on page (menu)
body: <p>I'm using a dropdown menu in my WP theme, with the use of select boxes. With the help of some jQuery the page changes when a new select option is chosen. However, when the new page is rendered the default option in the select menu is still "Start page" (the first one).</p>
  
  <p>What can I do to make that one change to the current page?</p>
  
  <p><strong>header.php:</strong></p>
  
  <pre><code>&lt;div id="navigation" role="navigation"&gt;
  
      wp_nav_menu(array(
          'container' =&gt; false,
          'menu_id' =&gt; 'nav',
          'theme_location' =&gt; 'primary', // your theme location here
          'walker'         =&gt; new Walker_Nav_Menu_Dropdown(),
          'items_wrap'     =&gt; '&lt;select&gt;%3$s&lt;/select&gt;',
          'fallback_cb'    =&gt; 'bp_dtheme_main_nav'
      ));
  
  
      class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu{
          function start_lvl(&amp;$output, $depth){
              $indent = str_repeat("\t", $depth);
              }
  
          function end_lvl(&amp;$output, $depth){
              $indent = str_repeat("\t", $depth);
          }
  
          function start_el(&amp;$output, $item, $depth, $args){
              $item-&gt;title = str_repeat("&amp;nbsp;- ", $depth).$item-&gt;title;
  
              parent::start_el($output, $item, $depth, $args);
  
              $href =! empty( $item-&gt;url ) ? ' value="'   . esc_attr( $item-&gt;url ) .'"' : '#';
  
              $output = str_replace('&lt;li', '&lt;option '.$href, $output);
          }
  
          function end_el(&amp;$output, $item, $depth){
              $output .= "&lt;/option&gt;\n"; // replace closing &lt;/li&gt; with the option tag
          }
      } ?&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>jquery:</strong></p>
  
  <pre><code>$("#navigation select").on('change', function() {
      window.location = jq(this).find("option:selected").val();
  });
  </code></pre>