XprsYrslf @ Twitter
 

XHTML to HTML plugin for WordPress

In setting up WordPress for the use of this website, I noticed it was fully written in XHTML, while some browsers don’t support the ‘application/XHTML+XML’ MIME type, so they get it served as ‘text/html’.  So, before I get too technical, I just wanted to display the website as HTML (4.01 Strict).

Fortunately, there was a simple plugin that solved this quickly:  XHTML to XML plugin. You can find more about the above issues on that page. For use in this website, I added 2 lines of my own, to turn onclick=”this.target=’something’”  in  onclick=”this.target=’something’”.

<?php
  ...
  $xhtml[5] = '/target="([_A-Za-z]+)"/';
  ...
  $html[5] = 'onclick="this.target=\'$1\'"';
  ...
?>

Thanks and credits go to John Kilroy.

Leave a Reply