Easy to learn tips for moving toolbars to the bottom of WordPress _php tips

Source: Internet
Author: User

From WordPress 3.1 introduced the concept of the toolbar, when the user logged in the foreground and backstage at the top of the page will display a black toolbar, through the toolbar can quickly create new articles, pages, media, users, as well as view articles and comments and other functions, the following figure:

Some WordPress users don't like the toolbar and choose to remove it. This toolbar is still a little useful, you now have a choice, do not like it at the top of the display, then we can move this toolbar to the bottom of the page, just add the following PHP code in the current theme of the 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;
 }
 #wpadminba. Quicklinks. Menupop ul {
  bottom:28px;
 }
 </style> ';
}
Background toolbar
add_action (' Admin_head ', ' Fb_move_admin_bar ');
Front tool bar
add_action (' Wp_head ', ' Fb_move_admin_bar ');

For Chrome users, a small problem with the toolbar moving to the bottom is that when the page is not loaded, the bottom of the chrome will display state information, which will block the WordPress toolbar.

Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.