Add code snippets to your site with “Code Snippet” for WordPress

It’s time consuming to write a blog entry and format code snippets for WordPress and other blog programs. You’ve got to translate < elements into &lt; and either use pre tags combined with code tags, combined with blah, blah, blah. If I have a complicated snippet, ordered lists were used for easier reading and to keep the pre tags from breaking the layout.

Code Snippet

My friend Alex suggested I look at the Code Snippet plug-in for WordPress. It transforms anything inside a set of <code> tags into an easy to read and copy presentation.

The instructions on the site are a bit vague, there’s little mention of how to use the plugin. The truth is, you don’t have to do anything! Just download the plugin, upload it to your plugin directory, and activate it. Instantly, anything on your blog that was surrounded by code tags is formatted.

You can alter the appearance in the options panel. It even uses microfomatting logic: insert lang=”CSS” or the appropriate language and the plugin will color code your example.

It’s pretty darn slick. Now I need to go back and fix older posts that used ordered lists or had code tags inline. If you see a post that needs to be fixed, please take a moment and leave a comment. I’m trying to update this site’s content as effeciently as possible.



, , ,




Leave a Reply

Your email address will not be published. Required fields are marked *