Last active
September 5, 2017 08:04
-
-
Save ckaklamanos/2bcee861864b77c72477 to your computer and use it in GitHub Desktop.
Wordpress white label / custom branding
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
// Put this in child theme's function.php | |
// Upload the logo to /imahes folder of child theme | |
// Logo must be 80 x 80 or apply custom CSS | |
// custom admin login logo | |
function custom_login_logo() { | |
echo '<style type="text/css"> | |
h1 a { | |
background-image: url(wp-content/themes/'.get_stylesheet().'/images/logo.png) !important; | |
width:186px!important; | |
background-size: 186px 65px!important; | |
} | |
</style>'; | |
} | |
add_action('login_head', 'custom_login_logo'); | |
function my_login_logo_url() { | |
return home_url(); | |
} | |
add_filter( 'login_headerurl', 'my_login_logo_url' ); | |
function my_login_logo_url_title() { | |
return "Site name"; | |
} | |
add_filter( 'login_headertitle', 'my_login_logo_url_title' ); | |
add_action( 'admin_bar_menu', 'remove_wp_logo', 999 ); | |
function remove_wp_logo( $wp_admin_bar ) { | |
$wp_admin_bar->remove_node( 'wp-logo' ); | |
} | |
add_filter('admin_footer_text', kcr_remove_admin_footer_text, 1000); | |
function kcr_remove_admin_footer_text($footer_text =''){ | |
return ''; | |
} | |
add_filter('update_footer', kcr_remove_admin_footer_upgrade, 1000); | |
function kcr_remove_admin_footer_upgrade($footer_text =''){ | |
return ''; | |
} | |
function remove_dashboard_widgets() { | |
global $wp_meta_boxes; | |
//unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); | |
//unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); | |
//unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); | |
//unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); | |
//unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']); | |
//unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); | |
//unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); | |
//unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); | |
$wp_meta_boxes['dashboard']['normal']['core'] = array(); | |
$wp_meta_boxes['dashboard']['side']['core'] = array(); | |
} | |
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' ); | |
remove_action( 'welcome_panel', 'wp_welcome_panel' ); | |
add_filter( 'contextual_help', 'mytheme_remove_help_tabs', 999, 3 ); | |
function mytheme_remove_help_tabs($old_help, $screen_id, $screen){ | |
$screen->remove_help_tabs(); | |
return $old_help; | |
} | |
add_filter('screen_options_show_screen', '__return_false'); | |
remove_action('wp_head', 'wp_generator'); | |
add_action('init', 'remove_vc_generator', 100); | |
function remove_vc_generator() { | |
remove_action('wp_head', array(visual_composer(), 'addMetaData')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment