The best way is to make a child theme. That way, when there’s a backlight update, it would not overwrite your changes. Looking at the source code, Matt already designed the Backlight theme to have a custom fontawesome loader This means that you don’t need to add anything to your theme’s functions.php
file.
There are many tutorials out there to make a child theme. This one is from Wordpress: Create a Child Theme – WordPress.com Support
As far as I remember, here are the minimal steps to create a child theme. The code shown is based on what I’m using on my site. Assuming your Backlight theme name is bl_theme
, I would call the child theme bl_theme_child
- Make a directory in
blog/wp-content/themes/bl_theme_child
. This assumes that the Wordpress installation is in/blog
, change this according to where you have WP installed. - In the child theme directory, create a file
style.css
with following content:
/*
Theme Name: Backlight Theme Child
Template: bl_theme
*/
- In the child theme directory, create the file
functions.php
with following content
<?php
function bl_theme_child_enqueue_styles() {
// Add local style
wp_enqueue_style('child-theme', get_stylesheet_directory_uri() .'/style.css', array('parent-theme'));
}
add_action( 'wp_enqueue_scripts', 'bl_theme_child_enqueue_styles' );
// Add font_awesome
function font_awesome() {
// echo your code for local Font Awesome resources.
}
add_action('wp_footer', 'font_awesome', 22);
?>
Obviously, you still need to add your local font awesome code.
- Select your new child theme in the Wordpress backend.
This is what I’m basically using right now. Looking at some of the tutorials out there, there are many other options that might be of value. But this seems to work for me
Hope this helps!