Archive

Posts Tagged ‘Text-Conversion’

How to embed HTML Code in WordPress post?

December 27th, 2008 No comments

Occasionally I am writing a post about HTML which I need to post the code to illustrate my argument (I guess I am not alone).

By default, WordPress will convert unrecognized uses of < and > into characters which actually look like &lt; and &gt;, which will “look” like a < and a > when posted. Or, if it finds the use of an HTML tag within the post, it will use the tag like it is HTML and you will have funky looking text and a messed up layout. (quoted from codex discussion)

I find this very frustrating when my post doesn’t appear to the way I wanted it to.

How to get around it?

You just simply convert your html open and close bracket “< and >” to “&lt; and &gt;“. However you are not going to do it one by one or do search-replace in text editor, it will be time consuming.

I wrote a simple Java Swing program which does just what I mention above plus it can convert html character code back to html code in case you need to make any changes.
Read more…

Categories: FAQ & Tip, Software