admin管理员组

文章数量:1304188

I am creating a theme where I will display some pages

The issue I have is that the WordPress editor is adding a lot of class, for example has-text-align-center

The only solution I found is adding <?php wp_head();?> into the head of my header

But this is adding too many things, I only want the classes created by the editor.

For example wp_head is adding margin-top: 32px !important; on the html tag. I do not want that.

I am creating a theme where I will display some pages

The issue I have is that the WordPress editor is adding a lot of class, for example has-text-align-center

The only solution I found is adding <?php wp_head();?> into the head of my header

But this is adding too many things, I only want the classes created by the editor.

For example wp_head is adding margin-top: 32px !important; on the html tag. I do not want that.

Share Improve this question asked Feb 13, 2021 at 15:15 AjouveAjouve 1112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

wp_head() is absolutely required for WordPress themes. It is how your theme should be adding styles, and it's how plugins can add their own scripts styles. Without it (and wp_footer(), which is also required) your theme will not function correctly.

WordPress does not load many styles itself, but the styles it does add are for markup created by the editor. The margin added to the HTML tag is to support the admin bar. Apart from the admin bar, emoji support, and the handful of editor styles, WordPress does not apply any additional styles to your theme.

本文标签: cssAdd core style in theme