Title: font awsome is not functioning after inserting the code in function.php
Last modified: May 26, 2022

---

# font awsome is not functioning after inserting the code in function.php

 *  [johannes999](https://wordpress.org/support/users/johannes999/)
 * (@johannes999)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/)
 * Hello,
    to use font awsome I have set this code in my function.php
 *     ```
       function enqueue_fa_script()  {
   
       wp_enqueue_script('fascript','https://kit.fontawesome.com/8b5c83d55f.js') ; 
       }
       add_action('wp_enqueue_scripts', 'enqueue_fa_script');
       ```
   
 * I got the kit code from font awsome website:
 *     ```
       <script src="https://kit.fontawesome.com/8b5c83d55f.js" crossorigin="anonymous"></script>
       ```
   
 * my html code is :
 *     ```
       <div class="header-section3">				
       		 direct bellen			
       	</div>			
       		<div class= "tel-icon">				
       				<i class="fa-solid fa-phone-xmark"></i>
       			</div> </div>
       ```
   
 * the problem is it is not working I don’t anderstand why?
    wat can be the error?
   thanks
    -  This topic was modified 4 years ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
    -  This topic was modified 4 years ago by [bcworkz](https://wordpress.org/support/users/bcworkz/).
      Reason: code format fixed
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffont-awsome-is-not-functioning-after-inserting-the-code-in-function-php%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15681827)
 * As far as I can see, this inclusion reloads various style files. In these the
   path to font files is also present, but they are apparently not executed and 
   also not found.
 * I like to use this plugin for this case: [https://wordpress.org/plugins/font-awesome/](https://wordpress.org/plugins/font-awesome/)–
   that saves the own embedding.
 *  Thread Starter [johannes999](https://wordpress.org/support/users/johannes999/)
 * (@johannes999)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15682110)
 * thanks,
    I did but I don’t see any action. do I have also copy and paste cdn 
   adres in my header, if yes from which website exactly?
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15682137)
 * No, as far as I know, you don’t have to do anything with the plugin other than
   integrating it. If you have questions about the handling, please ask in their
   support forum: [https://wordpress.org/support/plugin/font-awesome/](https://wordpress.org/support/plugin/font-awesome/)
 *  Thread Starter [johannes999](https://wordpress.org/support/users/johannes999/)
 * (@johannes999)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15682177)
 * thanks,
    johannes
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15682477)
 * I agree that using a plugin would be the easiest solution. But debugging your
   current implementation could be instructional. There appears to be an issue with
   how you built your FontAwesome kit. Three different styles are applied to the
   same font family name. Each needs to have its own name. There is no reference
   to class fa-phone-xmark in any CSS that is loaded on the page. There is not even
   CSS to relate class fa-solid to the FontAwesome font family.
 * If you were to add
 *     ```
       .fa-solid {
           font-family: 'FontAwesome';
       }
       ```
   
 * in Additional CSS and change the HTML class attribute to `"fa-solid fa-phone"`,
   you will see a FontAwesome icon on the page. “fa-phone” only because it’s defined
   in existing CSS. The icon may be poorly positioned and the wrong color, but at
   least FontAwesome is working. This is not a suggested solution, it only serves
   to demonstrate what the issues are.
 * I don’t know anything about building FontAwesome kits, but there must be an issue
   with it since the needed CSS is missing and the font-family name is wrongly re-
   used. For further guidance in building FontAwesome kits, I suggest using their
   own support resources:
    [https://fontawesome.com/support](https://fontawesome.com/support)
 * Or just use the plugin 🙂
 *  Thread Starter [johannes999](https://wordpress.org/support/users/johannes999/)
 * (@johannes999)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15682882)
 * thanks,
    but it is not working with plug in either.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15685959)
 * fa-phone-xmark is a pro-only icon. Try using one of the free icons like fa-phone.
   If you add the CSS I posted earlier to the customizer’s Additional CSS section
   and utilize only free icons, FontAwesome will at least work. Maybe not optimally
   and with a more limited set of icons and styles, but it’ll work.
 * Obviously a crude workaround. If you want to chase after a proper fix, I suggest
   manually implementing a webfont solution as [outlined in their docs](https://fontawesome.com/docs/web/use-with/wordpress/install-manually#set-up-webfont-with-font-awesome-free-cdn).
   You’d be limited to free icons this way. Be sure to remove any existing FontAwesome
   scripts and CSS to avoid conflicts. You can keep the existing HTML mostly as-
   is, except only reference free icons.
 * If you really need to use pro-only icons, I recommend building a new kit, striving
   to keep it as simple as possible, keeping as many default settings as you can.
 *  Thread Starter [johannes999](https://wordpress.org/support/users/johannes999/)
 * (@johannes999)
 * [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15689841)
 * thanks
    johannes

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘font awsome is not functioning after inserting the code in function.php’
is closed to new replies.

## Tags

 * [font-awsome](https://wordpress.org/support/topic-tag/font-awsome/)
 * [function.php](https://wordpress.org/support/topic-tag/function-php/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 8 replies
 * 3 participants
 * Last reply from: [johannes999](https://wordpress.org/support/users/johannes999/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/font-awsome-is-not-functioning-after-inserting-the-code-in-function-php/#post-15689841)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
