1

I've created a Text widget and put font-awesome icon HTML in editor Text Mode <i class="fab fa-facebook"></i> but toggling to Visual mode makes the code disappears though I can see it working on Frontend.

1

I think the issue is that WordPress removes empty tags from the editor. Try adding in a non-breaking space - Font Awesome should remove it so you shouldn't see any noticeable difference:

<i class="fab fa-facebook">&nbsp;</i>
| improve this answer | |
0

You have used the wrong syntax.

True syntax is <i class="fa fa-facebook"></i>.
Also verify that you have added font-awesome in your theme and function file.

| improve this answer | |
  • Not necessarily. Depends on the Font Awesome version. Font Awesome 5 uses fab instead of fa to display brands. – DSofa Jan 29 '19 at 2:56
0

@Harsh - The original poster was using the syntax from Font Awesome 5, where different prefixes are used based on whether it is a brand (fab prefix), solid (fas prefix), regular (far prefix) and light (fal prefix).

Also, I found that the "&nbsp;" did resolve disappearing icon the issue for me.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.