Below is the code to install Font Awesome icons using MaxCDN.
<?php | |
//* Load Font Awesome using MaxCDN | |
add_action('wp_enqueue_scripts', 'customprefix_enqueue_font_awesome'); | |
function customprefix_enqueue_font_awesome() { | |
wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'); | |
} |
Below is the code to load conditionally Font Awesome icons using MaxCDN.
<?php | |
//* Load Font Awesome using MaxCDN conditionally | |
add_action('wp_enqueue_scripts', 'customprefix_enqueue_font_awesome'); | |
function customprefix_enqueue_font_awesome() { | |
if (is_category() || is_home()) { | |
wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'); | |
} | |
} |