Home Forums ACF PRO Replace instead of append


Replace instead of append

  • 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.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Replace instead of append’ is closed to new replies.