Плагин для переноса admin bar в нижнюю часть WordPress
Для начала скажу что есть отличный плагин Stick Admin Bar To Bottom для этих целей. Сам плагин написан очень просто, всего две части кода.
Код плагина Stick Admin Bar To Bottom:
/*
Plugin Name: Stick Admin Bar To Bottom
Description: Annoyed by the new Admin Bar that is covering the top 28 pixels of your website, but you don't want it completely gone? This plugin sticks the Admin Bar to the bottom of your screen!
Author: Coen Jacobs
Version: 1.2
Author URI: https://coenjacobs.me
*/
function stick_admin_bar_to_bottom_css() {
$version = get_bloginfo( 'version' );
if ( version_compare( $version, '3.3', '<' ) ) {
$css_file = 'wordpress-3-1.css';
} else {
$css_file = 'wordpress-3-3.css';
}
wp_enqueue_style( 'stick-admin-bar-to-bottom', plugins_url( 'css/' . $css_file, __FILE__ ) );
}
add_action( 'admin_init', 'stick_admin_bar_to_bottom_css' );
add_action( 'wp_enqueue_scripts', 'stick_admin_bar_to_bottom_css' );Код стилей wordpress-3-3.css:
* html body {
margin-top: 0 !important;
}
body.admin-bar {
margin-top: -28px;
padding-bottom: 28px;
}
body.wp-admin #footer {
padding-bottom: 28px;
}
#wpadminbar {
top: auto !important;
bottom: 0;
}
#wpadminbar .quicklinks .ab-sub-wrapper {
bottom: 28px;
}
#wpadminbar .quicklinks .ab-sub-wrapper ul .ab-sub-wrapper {
bottom: -7px;
}Код стилей wordpress-3-1.css:
* html body {
margin-top: 0 !important;
}
body.admin-bar {
margin-top: -28px;
padding-bottom: 28px;
}
body.wp-admin #footer {
padding-bottom: 28px;
}
#wpadminbar {
top: auto !important;
bottom: 0;
}
#wpadminbar .quicklinks .menupop ul {
bottom: 28px;
}В самом плагине код размещается в основном файле под названием stick-admin-bar-to-bottom.php, рядом располагается папка css и в ней стили для admin bar файл под названием wordpress-3-3.css и wordpress-3-1.css.
Выложил исключительно для себя и вас как пример реализации такого кода. Вы можите смело пользоваться самим плагином.
/*

- Базовый курс по веб-дизайну;
- Верстка сайтов;
- Общий курс по CMS WordPress и продолжение курса по разработке шаблонов;
- Разработка сайтов на PHP.




