Support

Account

Home Forums General Issues Menu icons prepend vs append

Solved

Menu icons prepend vs append

  • Hello,

    I’m currently using this guide: https://www.advancedcustomfields.com/resources/adding-fields-menu-items/ to add menu icons to my site navigation. It is working as expected, however, I would like the <i class=”fa fa-‘.$icon.'”></i> to be before the $item->title instead of after (prepend vs append) and I’m lost on how to achieve this. Any ideas / help would be greatly appreciated.

    Thanks!

  • something like this would probably do it

    
    $item->title = '<i class="fa fa-'.$icon.'"></i> '.$item->title;
    
  • Thanks, John. This worked perfect.

    • JoDa

    • May 16, 2019 at 7:33 pm

    Hey John, just wanted to say THANKS for your always helpful posts. Throughout the years your answers on this forum have helped me countless times!

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.