Skip to content

Instantly share code, notes, and snippets.

@hofmannsven
Last active February 19, 2016 16:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hofmannsven/6208925 to your computer and use it in GitHub Desktop.
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.
#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';
}
@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;
}
<?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' );
}
?>
<?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' );
?>
<?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