Cyber Week Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Font Awesome link stripped out

Home Forums Support Font Awesome link stripped out

  • This topic has 3 replies, 2 voices, and was last updated 5 years ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #156688
    Michael Andersen

    Hi,

    GeneratePress theme should be ready for using Font Awesome, but when I insert fx <i class="fa fa-camera-retro"></i> it is stripped off when I save.
    I’m using Advanced TinyMCE editor.

    #156827
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This is a WP editor/Advanced TinyMCE editor issue.

    One solution is to place an HTML comment inside the icon:

    <i class="fa fa-camera-retro"><!-- icon --></i>

    #156992
    Michael Andersen

    Hi Tom

    Thanks. It works. Nice little feature.

    I kept searching and find also some other ways to deal with this problem. You can install the Advanced TinyMCE Config plugin. There you can set the option “extended_valid_elements” to “i[*]” (you add the i-tag to other “valid_elements”). That way the i-tag wont be stripped out.

    Alternatively, in your functions.php you can add the following code:

    
    function override_mce_options($initArray) {
       $opts = 'i[*]';
    /*   $initArray['valid_elements'] = $opts; */ /*only if you want to change all valid_elemnts */
       $initArray['extended_valid_elements'] = $opts;
       return $initArray;
     }
       add_filter('tiny_mce_before_init', 'override_mce_options');
    

    Btw, thank you for a very adaptive and well functioning theme, and your add-ons are great.

    /Michael

    #157101
    Tom
    Lead Developer
    Lead Developer

    Very cool – thanks for the other solutions! 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.