Font Awesome 4 Menus
[resolved] Wrap icon like text (3 posts)

  1. saas
    Posted 2 years ago #

    Thanks for such a useful plugin.

    I was working on project where I felt I should apply some styles to icon and I felt like wrapping it inside span like you have for text is good way to achieve it, so it will be good if you wrap the icon like

    if ($before) {
                    $newtext = '<span class="fontawesome-icon"><i class="' . implode(' ', $fontawesome_classes) . '"></i></span><span class="fontawesome-text"> ' . $text . '</span>';
                } else {
                    $newtext = '<span class="fontawesome-text">' . $text . ' </span><span class="fontawesome-icon"><i class="' . implode(' ', $fontawesome_classes) . '"></i></span>';

    won't hurt and will also allow people like me to use it they way we want.



  2. New Nine
    Plugin Author

    Posted 2 years ago #

    You can apply styles directly to the i class. For example, you could use

    .current-menu-item .fa-home {color: #000;}

    To make the home icon black for the current nav menu item.

  3. New Nine
    Plugin Author

    Posted 2 years ago #

    I'm marking this as resolved. Let us know if you have any other problems!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Font Awesome 4 Menus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic