Here we’ll add “col-eye” class within “li” tag
Output:
- <ul>
- <li class="col-eye"><a href="#">Lorem ipsam amit</a></li>
- <li class="col-eye"><a href="#">Lorem ipsam amit</a></li>
- <li class="col-eye"><a href="#">Lorem ipsam amit</a></li>
- <ul>
Input:
- <ul>
- <?php
- echo preg_replace( '#<li[^>]+>#', '<li class="col-eye">',
- wp_nav_menu(
- array(
- 'menu' => $nav_menu,
- 'container' => false,
- 'container_class' => false,
- 'menu_class' => false,
- 'items_wrap' => '%3$s',
- 'depth' => 1,
- 'echo' => false
- )
- )
- );
- ?>
- </ul>