I have a secondary nav on the sidebar with inline svg icons. I can change their color on hover with CSS. Here’s the markup
<ul class="icons">
<li>
<a href="index.php?page_id=39">
<div class="icon-box tool-box"><!-- inline svg here... --></div>
<h2>our tools</h2>
</a>
</li> <!-- and so on... -->
I was wondering if it would be possible to somehow add inline svg’s through the wordpress wp_nav_menu function to make the menu easy to manipulate by the client. I can of course add the icons as background-images but then I cannot target them on hover…
Thanks
You could use the
wp_nav_menu_items
filter to search & replace a certain string that you manually insert into the label of a menu item in the menus section of WordPress.For example: