Home >Backend Development >PHP Tutorial >Briefly understand the tips to move the toolbar in WordPress to the bottom, wordpress tips_PHP tutorial

Briefly understand the tips to move the toolbar in WordPress to the bottom, wordpress tips_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 09:01:51857browse

Learn briefly about the tips to move the toolbar in WordPress to the bottom, wordpress tips

The concept of toolbar has been introduced since WordPress 3.1. When the user logs in, it will be displayed in the foreground A black toolbar will be displayed at the top of the page in the background. Through the toolbar, you can quickly create new articles, pages, media, users, and view articles and comments, as shown below:

20151231153927105.png (474×259)

Some WordPress users don’t like this toolbar and have chosen to remove it. By the way, this toolbar is still somewhat useful. Now you have another choice. If you don’t like it to be displayed at the top, then we can move this toolbar to the bottom of the page. Just add the following php code to the functions.php of the current theme. That’s it:

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;
 }
 #wpadminba .quicklinks .menupop ul {
  bottom: 28px;
 }
 </style>';
}
// 后台工具栏
add_action( 'admin_head', 'fb_move_admin_bar' );
// 前台工具栏
add_action( 'wp_head', 'fb_move_admin_bar' );

For Chrome users, there is a small problem when the toolbar is moved to the bottom. When the page has not been loaded, status information will be displayed at the bottom of Chrome, which will block the WordPress toolbar.

Articles you may be interested in:

  • Detailed explanation of the registration menu and calling menu in WordPress
  • How to implement the secondary navigation menu in WordPress using JavaScript
  • Key points for implementing the scrolling and fade effects of WordPress navigation menu
  • Explanation of the PHP core method of making navigation menu in WordPress

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1087274.htmlTechArticleLearn briefly about the tips to move the toolbar in WordPress to the bottom. The wordpress tips have been introduced since WordPress 3.1 The concept of toolbar, the pages in the foreground and backend when the user logs in...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn