Font awesome Icon HTML in widgets disappear on save

admin2025-06-04  3

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.

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.

Share Improve this question asked Jun 18, 2018 at 12:08 AnkitAnkit 135 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 2

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>

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.

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

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748967384a315233.html

最新回复(0)