David Stockdale's Scrapcode

Adding Font Awesome

To add Font Awesome to your site simply add this code to “functions.php”.

/**
 * Adds Font Awesome (https://slickmedia.co.uk/blog/add-fontawesome-5-to-wordpress/)
 * By David Stockdale
 */
function wpb_load_fa() {
	wp_register_script( 'FontAwesome', 'https://use.fontawesome.com/releases/v5.14.0/js/all.js', null, null, true );
	wp_enqueue_script('FontAwesome');
}
 
add_action( 'wp_enqueue_scripts', 'wpb_load_fa' );

Leave a Reply