Changer l’aspect du dashboard WordPress

Changer l’aspect du dashboard WordPress

Voici des fonctions à insérer dans le fichier functions.php de son site wordpress dans le but de modifier le panneau d’administration par défaut. Ici je fais appel à une feuille de style particulière à l’admin : je l’appelle ici style.css, mais ca n’a pas d’impact puisque je vais le placer  dans un dossier css, donc pas de confusion avec le fichier style.css général du thème. On relie notre fichier grâce à l’add action (‘admin_enqueue_scripts‘.

function admin_styles(){
wp_register_style( 'admin_stylesheet', plugins_url( 'css/style.css', __FILE__ ) );
wp_enqueue_style( 'admin_stylesheet' );
}
add_action( 'admin_enqueue_scripts', 'admin_styles' );

On créée donc un dossier css à la racine de son thème et on y insère le fichier  de style ‘style.css'(on l’appelle bien sur comme on veut) : à partir de cette base, modifiez la suite comme vous voulez.

#wpfooter #footer-left img {
height: 1.2em;
width: auto;
margin-right: 0.5em;
}

/* styling for admin menu */

/* background and text color */
#adminmenuback, #adminmenuwrap {
background-color: #58595b;
border-color: #fff;
}

#wpadminbar{background:#069}
#wpbody{background-image: url("http://monwordpress/wp-content/themes/CortechsTutos/img/22.jpg");
background-repeat: repeat;
background-attachment: fixed ;
padding-left:0;}
#adminmenu li.menu-top:hover, #adminmenu li.opensub > a.menu-top, #adminmenu li > a.menu-top:focus {
background-color: #58595b;
color: #d54e21;
text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
#adminmenu li.wp-menu-separator {
background: #fff;
border-color: #fff;
}

/* links in admin menu */
#adminmenu a,
#adminmenu li.menu-top:hover,
#adminmenu li.opensub > a.menu-top,
#adminmenu li > a.menu-top:focus {
color: #fff;
}
#adminmenu a:hover,
#adminmenu a:active {
color: #fff;
text-decoration: underline;
}
#adminmenu .wp-submenu a {
color: #58595b;
}

/* change color of arrow to submenus */
#adminmenu li.wp-not-current-submenu .wp-menu-arrow,
#adminmenu li.wp-not-current-submenu .wp-menu-arrow div {
background: #58595b;
}

/* active screen as seen in menu - change the background and arrow colour */
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
#adminmenu li.current a.menu-top,
.folded #adminmenu li.wp-has-current-submenu,
.folded #adminmenu li.current.menu-top,
#adminmenu .wp-menu-arrow,
#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
background: #9e4059;
}
#adminmenu li.wp-has-current-submenu .wp-menu-arrow,
#adminmenu li.wp-has-current-submenu .wp-menu-arrow div {
background: #9e4059;
}

/* links elsewhere */
a:hover, a:active {
color: #9e4059;
}

/* buttons */
.wp-core-ui .button-primary {
background: #4b8938;
background-image: -webkit-gradient(linear,left top,left bottom,from(#7ea367),to(#4b8938));
background-image: -webkit-linear-gradient(top,#7ea367,#4b8938);
background-image: -moz-linear-gradient(top,#7ea367,#4b8938);
background-image: -ms-linear-gradient(top,#7ea367,#4b8938);
background-image: -o-linear-gradient(top,#7ea367,#4b8938);
background-image: linear-gradient(to bottom,#7ea367,#4b8938);
border-color: #4b8938;
color: rgba(255,255,255,0.95);
-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
}
.wp-core-ui .button-primary.active,
.wp-core-ui .button-primary:hover,
.wp-core-ui .button-primary:active {
background: #9e4059;
background-image: -webkit-gradient(linear,left top,left bottom,from(#ba7582),to(#9e4059));
background-image: -webkit-linear-gradient(top,#ba7582,#9e4059);
background-image: -moz-linear-gradient(top,#ba7582,#9e4059);
background-image: -ms-linear-gradient(top,#ba7582,#9e4059);
background-image: -o-linear-gradient(top,#ba7582,#9e4059);
background-image: linear-gradient(to bottom,#ba7582,#9e4059);
border-color: #9e4059;
color: rgba(255,255,255,0.95);
-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
}