Hey there! I used this page as a guide to add an icon-field to the WordPress menu-items. The included code however appends to icon to the menu label, and I need it to replace the ‘normal’ label. Is there a way to do this?
Thanks in advance!
Hi @rikbuist97
Thanks for reaching out to us.
You can replace the title by assigning the icon value to the title as below.
$item->title = ' <i class="fa fa-'.$icon.'"></i>';
Hopefully this helps.