Плагин для переноса admin bar в нижнюю часть WordPress
Для начала скажу что есть отличный плагин Stick Admin Bar To Bottom для этих целей. Сам плагин написан очень просто, всего две части кода.
Код плагина Stick Admin Bar To Bottom:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
/* 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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
* 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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
* 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; } |
Выложил исключительно для себя и вас как пример реализации такого кода. Вы можите смело пользоваться самим плагином.

/*

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