In my last post, I included a sample of some html code. If you’ve ever tried to do that on a wordpress blog, I bet you had the same problems I did. None of the code appeared correctly when I posted the article. I started out using html ‘pre’ tags and then tried using ‘code’ tags without changing the result. It only showed the PHP code and all of the html was invisible.
It took only a couple of minutes of googling to find this cool page: SimpleCode. The page offers a way for you to input your code sample and then click a button to turn it into encoded text that your wordpress will render properly so you can share your code samples.
Since I’d already posted my article, I used this page to quickly translate my code and then pasted it back into my post. It worked perfectly. Then I went back and saw that there’s a SimpleCode wordpress plugin available that is based off the same page and allows you to encode your snippets of code from within your wordpress dashboard. I’ve installed the plugin already (just put one file in your plugins folder) and it works great.