title: Add active class to a menu link with WordPress
body: <p>I am using the WordPress function <strong>wp_nav_menu</strong> to create my main menu.</p>
  
  <p>In this menu, I have a link named "News" for exemple and I would like to make this link highlight when I am in the single.php file template.</p>
  
  <p>At the moment, my code is the one below. I am not "used" to work with this WordPress function.</p>
  
  <pre><code>&lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'primary', 'menu_class' =&gt; 'nav-menu' ) ); ?&gt;
  </code></pre>
  
  <p>Is there any way to said for exemple</p>
  
  <pre><code>if($is_single())
  {
  echo 'class="active"';
  }
  </code></pre>
  
  <p>I have checked arround on SO and I founded some informations that might be interesting but nothing is really answering my question.</p>
  
  <p>On this page, some one suggest to check in "Show on screen" options : <a href="https://stackoverflow.com/questions/13671669/add-class-to-dropdown-menu-inside-dynamic-wordpress-menu">add class to dropdown menu inside dynamic wordpress menu</a></p>
  
  <p><img src="https://i.stack.imgur.com/Fh87O.png" alt="enter image description here"></p>
  
  <p>I also found this page in the codex, but I'm not sure how to use it : <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu#How_to_add_a_parent_class_for_menu_item" rel="nofollow noreferrer">http://codex.wordpress.org/Function_Reference/wp_nav_menu#How_to_add_a_parent_class_for_menu_item</a></p>
  
  <p>Thx in advance for the help!</p>