Last active
September 21, 2021 09:58
-
-
Save dustinleer/6d55cd81bdd0d8cb58d9bcebde18b370 to your computer and use it in GitHub Desktop.
Override 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
// customize admin bar css | |
function override_admin_bar_css() { | |
if ( is_admin_bar_showing() ) { | |
/* Could add a custom enqueue here instead of a style tag */ | |
/* Example 👇 */ | |
$version = time(); | |
wp_enqueue_style( 'ip_master-style', get_stylesheet_directory_uri() . '/dist/css/style.css', array(), $version ); | |
?> | |
<style type="text/css"> | |
/* Add Styles Here */ | |
#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary > #wp-admin-bar-search #adminbarsearch input.adminbar-input { | |
min-width:auto; | |
} | |
</style> | |
<?php } | |
} | |
// on backend area | |
add_action( 'admin_head', 'override_admin_bar_css' ); | |
// on frontend area | |
add_action( 'wp_head', 'override_admin_bar_css' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment