Heim  >  Artikel  >  php教程  >  Remove WordPress Admin Bar?CSS

Remove WordPress Admin Bar?CSS

不言
不言Original
2018-05-16 15:58:361291Durchsuche

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; }
	}

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');
}

Use it. ?You’re welcome.

Stellungnahme:
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
Vorheriger Artikel:php绘制一个扇形的方法Nächster Artikel:php绘制一条弧线的方法