Why is WP modifying HTML code entered into the post window?
-
Hi All,
I’ve since upgraded to 2.1 and something strange is happening.
In the write post window. I have entered the following HTML code, which is an image thumbnail with a link to the larger sized version:
<div class="caption left">
<a target="_blank" href="https://site.com/image.jpg">
<img alt="Image Name" title="Image Name" src="https://site.com/image.thumbnail.jpg" />
</a>
<div align="center">Image Name</div>
</div>
I got the idea for this code from a wordpress article that I read in April last year:
https://codex.www.ads-software.com/Wrapping_Text_Around_ImagesThe code has been working fine on the previous version of WordPress. In the new version of WordPress, after publishing the post, when I look at the web page source of the blog through a web browser, the code has been modified slightly as seen below:
<div class="caption left">
<p>
<a target="_blank" href="https://site.com/image.jpg">
<img alt="Image Name" title="Image Name" src="https://site.com/image.thumbnail.jpg" />
</a>
</p>
<div align="center">
<p>Image Name</p>
</div>
</div>
If you look closely, WordPress has inserted paragraph tags <p> around the image and link, and around the caption text.If I compare the page source of the page generated by the previous version of WordPress when compared with version 2.1, the only difference is the paragraph tags. It was not putting them before.
The problem is:
A) it’s modifying code I have entered. I would prefer it not to do this.
B) it’s causing the size of the thumbnails to go crazy in firefox (IE6 and Opera9 are fine). This was not occurring before in the previous version.Any help on this would be greatly appreciated.
Thanks in advance,
Adrian
- The topic ‘Why is WP modifying HTML code entered into the post window?’ is closed to new replies.