0

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.

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.