Below is the code to install Font Awesome icons using MaxCDN.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
} | |
} |