How to override the automatic "corrections" WP makes to html?
-
Hi!
I’ve got bit of problem because WP is automatically changing (=”correcting”) my html in a way that creates mistake.
I have a shortcode I wrote into my custom theme. This shortcode is supposed to create a small div element between the text. (That element contains other things, but it should not matter.) In the layout the div should look as if it was a single word in the text.
.
WHAT I TRY TO DOSo when I write in the WP post/page editor like this:
Text text text text text text text [MY-SHORTCODE] text text text text text text text
It should be seen on the page like this:
Text text text text text text text STUFF-IN-THE-DIV text text text text text text text
The html of it should be like this:
<p>Text text text text text text text <div style="display:inline-block">STUFF-IN-THE-DIV</div> text text text text text text text</p>
.
THE PROBLEMHowever, it does not work like that. Wp does “correction” to the html before outputting it to the browser. It makes my shortcode-made element cut the line in wrong way. So it look like this:
Text text text text text text text
STUFF-IN-THE-DIV text text text text text text textAnd the html is twisted like this:
<p>Text text text text text text text </p> <div style="display:inline-block">STUFF-IN-THE-DIV</div> text text text text text text text <p></p>
My question is how can I avoid this automatic “correction” and get the html which intend to get.
- The topic ‘How to override the automatic "corrections" WP makes to html?’ is closed to new replies.