Full tutorial: http://hofmannsven.com/2013/laboratory/wordpress-dashicons/
Last active
February 19, 2016 16:56
-
-
Save hofmannsven/6208925 to your computer and use it in GitHub Desktop.
Building a responsive WordPress admin interface with the MP6 plugin and customized Dashicons.
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
#dashboard_right_now li.{post_type}-count a:before, | |
#adminmenu #menu-posts-{post_type}.menu-icon-post div.wp-menu-image:before { | |
font-family: 'custom_dashicons' !important; | |
content: '\999'; | |
} |
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
@font-face { | |
font-family: 'custom_dashicons'; | |
src: url('../fonts/custom_dashicons.eot'); // this is for IE | |
} | |
@font-face { | |
font-family: 'custom_dashicons'; | |
src: url(data:application/font-woff;charset=utf-8;base64,xxx...) format('woff'), | |
url(data:application/x-font-ttf;charset=utf-8;base64,xxx...) format('truetype'); | |
font-weight: normal; | |
font-style: normal; | |
} |
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 | |
if ( 'mp6' === get_user_option( 'admin_color' ) ) { | |
function load_custom_admin_styles() { | |
wp_register_style( 'custom_dashicons', get_template_directory_uri() . '/css/custom_dashicons.css', false, '1.0.0' ); | |
wp_enqueue_style( 'custom_dashicons' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'load_custom_admin_styles' ); | |
} | |
?> |
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 | |
function load_custom_admin_styles() { | |
wp_register_style( 'custom_dashicons', get_template_directory_uri() . '/css/custom_dashicons.css', false, '1.0.0' ); | |
wp_enqueue_style( 'custom_dashicons' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'load_custom_admin_styles' ); | |
?> |
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 | |
function check_active_plugins() { | |
if ( is_plugin_active( 'mp6/mp6.php' ) ) { | |
function load_custom_admin_styles() { | |
wp_register_style( 'custom_dashicons', get_template_directory_uri() . '/css/custom_dashicons.css', false, '1.0.0' ); | |
wp_enqueue_style( 'custom_dashicons' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'load_custom_admin_styles' ); | |
} | |
} | |
add_action( 'admin_init', 'check_active_plugins' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment