Heim > php教程 > php手册 > Hauptteil

Remove WordPress Admin Bar?CSS

不言
Freigeben: 2018-05-16 15:58:36
Original
1290 Leute haben es durchsucht

Read the full article at: Remove WordPress Admin BarCSS A version or two back, WordPress decided to add a toolbar for logged in users on the display side thats about the sites theme. ?I get why they did it but its an annoyance to me I dont

Read the full article at:  Remove WordPress Admin Bar CSS

Treehouse
Wufoo

A version or two back, WordPress decided to add a toolbar for logged in users on the display side that’s about the site’s theme. ?I get why they did it but it’s an annoyance to me — I don’t care to see it. ?To accomplish this task, WordPress injects the following into?every page:

#wpadminbar { display:none; }
	html { margin-top: 32px !important; }
	* html body { margin-top: 32px !important; }
	@media screen and ( max-width: 782px ) {
		html { margin-top: 46px !important; }
		* html body { margin-top: 46px !important; }
	}
Nach dem Login kopieren

Bleh. ?You can remove this CSS and the admin bar using the following code which should be placed with your functions.php file:

add_action('get_header', 'remove_admin_login_header');
function remove_admin_login_header() {
	remove_action('wp_head', '_admin_bar_bump_cb');
}
Nach dem Login kopieren

Use it. ?You’re welcome.

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Empfehlungen
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!