title: How to add class to link in wp_nav_menu?
body: <p>I am trying to out a wp menu without ul and li and have a class added to the  element.</p>
  
  <p>I have tried adding this in my function.php</p>
  
  <pre><code>function add_menuclass($ulclass) {
    return preg_replace('/&lt;a /', '&lt;a class="list-group-item"', $ulclass, 1);
  }
  add_filter('wp_nav_menu','add_menuclass');
  </code></pre>
  
  <p>And in my template I have:</p>
  
  <pre><code>&lt;?php
   $menuParameters = array(
     'menu'  =&gt; 'Videos',
     'container'       =&gt; false,
     'echo'            =&gt; false,
     'items_wrap'      =&gt; '%3$s',
     'depth'           =&gt; 0,
  );
  
    echo strip_tags(wp_nav_menu( $menuParameters ), '&lt;a&gt;' );
  ?&gt;
  </code></pre>
  
  <p>But the output only applies the class to the first item and not all of the <code>&lt;a&gt;</code>s as expected.</p>
  
  <pre><code>&lt;div class="list-group"&gt;
     &lt;a class="list-group-item" href="#"&gt;First item&lt;/a&gt;
     &lt;a href="#"&gt;Second item&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am trying to achieve this, basically to apply that class to ALL my item (not sure why it applies it to only one) - <strong>No jQuery please.</strong></p>
  
  <pre><code>&lt;div class="list-group"&gt;
     &lt;a class="list-group-item" href="#"&gt;First item&lt;/a&gt;
     &lt;a class="list-group-item" href="#"&gt;Second item&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>