仅适用于WordPress 3.3以上版本。 将此CSS添加到您CSS文件中,或者将所有代码添加到您的functions.php文件中,或者制作一个快速的小插件。
function fb_move_admin_bar() {
echo '
<style type="text/css">
body {
margin-top: -28px;
padding-bottom: 28px;
}
body.admin-bar #wphead {
padding-top: 0;
}
body.admin-bar #footer {
padding-bottom: 28px;
}
#wpadminbar {
top: auto !important;
bottom: 0;
}
#wpadminbar .quicklinks .menupop ul {
bottom: 28px;
}
</style>';
}
// on backend area
add_action( 'admin_head', 'fb_move_admin_bar' );
// on frontend area
add_action( 'wp_head', 'fb_move_admin_bar' );
翻译自: https://css-tricks.com/snippets/wordpress/move-wordpress-admin-bar-to-the-bottom/