I'm building a theme, but in order for it to work correctly, the admin is having to include a HTML markup inside the WYSIWUG editor (such as div
, li
, .classnames
, etc.). This to me is a bad idea.
Can I generate/append certain HTML elements depending on what they submit? For example, I would need the following to happen:
- Wrap all images in
li
tags - All paragraphs before an image, be wrapped in a
div
- All paragraphs after an image, be wrapped in another
div
Would this rely on PHP, jQuery, or does WordPress have a built in function for helping me with this?