Below is the code to install Ionicons icon fonts 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 Ionicons using MaxCDN | |
add_action('wp_enqueue_scripts', 'customprefix_enqueue_ionicons'); | |
function customprefix_enqueue_ionicons() { | |
wp_enqueue_style('ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css'); | |
} |
Below is the code to install Ionicons icon fonts using MaxCDN conditionally.
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 Ionicons using MaxCDN conditionally | |
add_action('wp_enqueue_scripts', 'customprefix_enqueue_ionicons'); | |
function customprefix_enqueue_ionicons() { | |
if (is_category() || is_home()) { | |
wp_enqueue_style('ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css'); | |
} | |
} |