Skip to content

How To Wrap WordPress Post In A Div

You might want to apply custom CSS to a WordPress Post by wrapping the entire post in a custom <div>.
In WordPress 5.x you can wrap your post in a custom <div> by simply adding adding blocks of type ‘Custom HTML’ at the top and bottom of the post.

The top block will be the start of div (e.g. <div class=’my-class’>). The block at the bottom of the post closes the div (</div>). That’s all there is to it.