WordPress Plugin to Format Code Samples

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.

Be Sociable, Share!
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

2 Responses to WordPress Plugin to Format Code Samples

  1. LearningNerd says:

    Hey, that’s a great find! Thanks!

  2. ray says:

    Thanks, Liz. I love these type of quick solutions to pesky, little problems. This is one of those issues that isn’t really a big deal, but is incredibly frustrating if you don’t know how to get around it.

    BTW, congratulations on the new domain and hosting! It’s really awesome, isn’t it? I have to take time to catch up on your blog, especially all the wordpress and PHP stuff. Expect links!

Comments are closed.