// Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//use.fontawesome.com/releases/v5.2.0/css/all.css' );
}
// defaults
function ariana_pro_customizer_get_default_custom_icon() {
return 'f004';
}
/* Adding custom icons to the customizer */
$wp_customize->add_section(
'ariana_pro_custom_icons',
array(
'title' => __('Title Icon', 'ariana pro'),
'priority' => 90,
)
);
$wp_customize->add_setting(
'ariana_pro_custom_icon',
array(
'default' => ariana_pro_customizer_get_default_custom_icon(),
)
);
$wp_customize->add_control(
'ariana_pro_custom_icon',
array(
'description' => __('Enter the 4 digit code of the <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome Icon</a> you would like to replace the ♥ with.', 'ariana pro'),
'label' => __('Enter Unicode', 'ariana pro'),
'section' => 'ariana_pro_custom_icons',
)
);
}
$custom_icon = get_theme_mod('ariana_pro_custom_icon', ariana_pro_customizer_get_default_custom_icon() );
$css .= ( ariana_pro_customizer_get_default_custom_icon() !== $custom_icon ) ? sprintf( '
.entry-title:before,
.widget-title:before,
.sidebar .featured-content .entry-title:before {
content: "\%1$s";
}
', $custom_icon ) : '';