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
#change le texte de pied de page de l'admin | |
function remove_footer_admin () { | |
echo 'Design by <a href="https://glink.fr" target="_blank" rel="noopener noreferrer">Glink</a> | | |
Powered by <a href="https://www.wordpress.org" target="_blank" rel="noopener noreferrer">WordPress</a>'; | |
} |
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
# d'abord, une fonction pour ajouter le lien vers votre favicon | |
function new_favicon() { | |
$favicon_url = get_stylesheet_directory_uri() . '/images/favicon.ico'; | |
echo '<link rel="shortcut icon" href="' . $favicon_url . '">'; | |
} | |
# maintenant on ajoute la fonction sur les pages de login et d'administration | |
add_action('login_head', 'new_favicon'); | |
add_action('admin_head', 'new_favicon'); |
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
#hook pour personnaliser le logo de la partie administration | |
add_action('admin_head', 'my_custom_logo'); | |
function my_custom_logo() { | |
echo '<style type="text/css"> | |
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; } | |
</style>'; | |
} |
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
# personnaliser le logo de la page login | |
function custom_login_logo() {echo '<style type="text/css">h1 a { background-image: url('.get_bloginfo('template_directory').'/images/custom-login-logo.png) !important; }</style>'; } | |
add_action('login_head', 'custom_login_logo'); | |
# on peut aussi ajouter un fichier CSS personnalisé | |
# (il vous faudra créer le fichier admin.css dans votre thème) | |
function custom_login_css() | |
{ | |
echo '<link rel="stylesheet" href="' . get_bloginfo('stylesheet_directory') . '/admin.css" type="text/css" media="all">'; | |
} |
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
# change le numero de version de wp dans la partie admin | |
function change_footer_version() { | |
return 'Version 1.0.0'; | |
} | |
add_filter( 'update_footer', 'change_footer_version', 9999 ); |
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
# ajoute un widget a la partie admin | |
function votre_dashboard_widget() { | |
echo'<h3>Bienvenue</h3><p>Votre contenu HTML ou PHP.</p>'; | |
} | |
function ajout_votre_dashboard_widget() { | |
wp_add_dashboard_widget( 'votre_dashboard_widget', __( 'Le titre du Widget' ), 'votre_dashboard_widget' ); | |
} | |
add_action('wp_dashboard_setup', 'ajout_votre_dashboard_widget' ); |
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
# supprime des widgets au tableau de bord | |
add_action(‘wp_dashboard_setup’, ‘custom_dashboard_widgets’); | |
function custom_dashboard_widgets() { | |
global $wp_meta_boxes; | |
# supprime les widgets | |
// var_dump( $wp_meta_boxes['dashboard'] ); // utilisez le pour récupérer tous les ID des widgets | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); |
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
#Modifier le menu aide de l’administration | |
add_filter( 'contextual_help', 'glink_help', 5, 3 ); | |
function glink_help( $old_help, $screen_id, $screen ) | |
{ | |
# ajoute un onglet au menu Aide | |
# Pour en ajouter un autre: copiez le code, changez l'id et créez un nouveau callbacks personnalisé | |
$screen->add_help_tab( array( | |
'id' => 'glink', | |
'title' => 'Aide Supplémentaire', | |
'content' => '<p>Pour obtenir plus d\'aide n\'hésitez pas à me contacter :</p>', |
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
/** | |
* Personnalisation de la page wp-login | |
*/ | |
/* Fonction pour changer le lien du logo */ | |
function wpc_url_login(){ | |
return "https://glink.fr/"; // votre URL ici | |
} | |
add_filter('login_headerurl', 'wpc_url_login'); | |
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
/** | |
* admin.css a creer dans le dossier de votre theme | |
* qui remplacera les styles du fichier originale | |
*/ | |
/* Personnalisation du background de la page on y ajoute une image de fond en cover donc responsive */ | |
body.login{ | |
background:url(images/background.jpg) no-repeat center center fixed; | |
-webkit-background-size: cover; |
OlderNewer