Linking Font Awesome with X Theme

Hi,

I purchased Font Awesome and I followed your guide on another users post to add the following to my child functions folder… But I am having problems, are you able to help me please?

add_action('wp_head','font_awesome_scripts');
function font_awesome_scripts() { 
?>
	<script defer src="/js/packs/solid.js"></script>
	<script defer src="/js/fontawesome.js"></script>
<?php 
}

I then used this code in Pro:

<i class="fas fa-walking"></i>

But the icon is not showing up. I wonder if I have missed a step, or if I have placed the font awesome folders in the wrong place? I placed mine in my plugins folder, then added this to functions…

add_action('wp_head','font_awesome_scripts');
function font_awesome_scripts() { 
?>
	<script defer src="/wp-content/plugins/fontawesome-pro/js/packs/solid.js"></script>
	<script defer src="/wp-content/plugins/fontawesome-pro/js/fontawesome.js"></script>
<?php 
}

I think I got it working, I forgot to add the CSS link to my functions. Although I welcome feedback if you think I am doing this wrong.

For anyone else struggling this is what I added in my child theme functions.php

add_action('wp_head','font_awesome_scripts');
function font_awesome_scripts() { 
?>
	<script defer src="/wp-content/plugins/fontawesome-pro/js/packs/solid.js"></script>
	<script defer src="/wp-content/plugins/fontawesome-pro/js/fontawesome.js"></script>
	<link href="/wp-content/plugins/fontawesome-pro/css/all.css" rel="stylesheet"> <!--load all styles -->

<?php 
}

(That’s with me install font awesome in the plugins folder, you will need to change path if you install somewhere else).

Hey There,

We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.