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

Remove WordPress Admin Bar?CSS

不言
不言asal
2018-05-16 15:58:361292semak imbas

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.

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel sebelumnya:php绘制一个扇形的方法Artikel seterusnya:php绘制一条弧线的方法