Using Font Awesome in Modern Business Pro theme

Font Awesome is enqueued in the file includes/ModernBusiness.php, tadalafil discount line 214.

wp_enqueue_style( 'font-awesome-css-min', cialis usa get_template_directory_uri() . '/includes/css/font-awesome.min.css' );

I had included it myself in my child theme’s functions.php with this code:

//* Load Font Awesome
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' );
}

It turns out, my function wasn’t needed. I commented it out, and Font Awesome still works.

How does this file get included? It starts with line 15 of functions.php:

include_once get_template_directory() . '/includes/theme-functions.php'; // SDS Theme Options Functions

This includes the file theme-functions.php, which is located in the folder /includes.

I searched for ‘awesome’ in the file theme-functions.php. line 915:

wp_enqueue_style( 'font-awesome-css-min', get_template_directory_uri() . '/includes/css/font-awesome.min.css' );

There it is. but why didn’t my first attempts at using Font Awesome fonts work? if we look at the code surrounding the wp_enqueue_style (method? what’s the correct name?):

// Theme Option Fonts (Social Media)
if ( ! empty( $sds_theme_options['social_media'] ) ) {
$social_networks_active = false;

foreach( $sds_theme_options['social_media'] as $network => $url )
if ( ! empty( $url ) ) {
$social_networks_active = true;
break;
}

if ( $social_networks_active )
wp_enqueue_style( 'font-awesome-css-min', get_template_directory_uri() . '/includes/css/font-awesome.min.css' );
}

This means if no social network links have been added to the theme options, the wp_enqueue_style (thing?) is never called. When I fist tried using Font Awesome, i didn’t have ant social media links added to my theme options. If I remove the links, Font Awesome should go back to not working.

That didn’t work. I removed the link, yet the phone icon was still there. When is functions.php called? Is it every time the page is loaded? Yes, it should be. Did I read the above code incorrectly?
the if ( ! empty( and the foreach( are used to set the $social_networks_active variable. The final if statement would only carry out the wp_enqueue_style function(?) if the $social_networks_active = true.

Did I include font awesome somewhere else?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>