I want to have two <span>
tags inside a WordPress menu as shown in the code below:
<ul>
<li><a href="#!"><span>Home</span><span>Home</span></a></li>
<li><a href="#!"><span>About</span><span>About</span></a></li>
<li><a href="#!"><span>Contact</span><span>Contact</span></a></li>
</ul>
First, you can use Walker. Create new Class and you need a function called start_el (you can find it inside a wp-includes/class-walker-nav-menu.php). Most simple way just to copy it all. You need to change $item_output
You can mention anchor tag and inside it $title (links title). You can just wrap $title into span and double it, like that:
Notice $args->link_before/after can be used via calling wp_nav_menu and there is no need to add extra span (I'll explain it bellow).
Second way: a little bit tricky but simplier and it will work. Call wp_nav_menu like this:
And in your functions.php