Where in the page's HTML is the admin bar supposed to appear? On my blog it is added to the footer section, with the result being that there is a gap above it when viewing the blog on mobile phones. (The admin bar has position:absolute; at small resolutions, and so does the footer it's contained within.)

有帮助吗?

解决方案

It's supposed to be in the footer, and it's positioned with CSS. This is partly because at the time that it was introduced there wasn't a standard hook in themes for placing something at the very top of the page. Instead it is added to the wp_footer hook.

It's the theme's job to make sure it accounts for the presence of the admin bar, which it can do using the admin-bar body class that's added when the bar is present.

许可以下: CC-BY-SA归因
scroll top