Adding div to WordPress page content

I am wondering if there is a way to add div to specific elements in the WordPress page content?

For example, I would want to wrap a div around content starting at a H2 element and ending after an img element. The div should have custom classes assigned to them.

Is there anyway to do this? I don't want to have to hard-code the div so that other people can easily edit the page content.

Thanks!

Topic html content posts Wordpress

Category Web


I used JQuery to fix this problem and target the specific elements.

In particular, I used: wrap, wrapInner, wrapAll, replaceWith, unWrap, and remove.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.