Posting Code in Your WordPress Blog

Posting code in a WordPress blog was a pain for a long time. Everyone had a different way to format their code with CSS, and no solution was really that good. At least not compared to what I am about to show you.

The Syntax Highlighter plugin allows for code to easily be displayed in an appealing, easy to use format. All you have to do is install the plugin. Download it here:

http://wordpress.org/extend/plugins/syntaxhighlighter-plus/

After installing the plugin you will want to wrap your code in tags like this: [sourcecode language='css']..[/sourcecode] You can view other examples of the plugin in use on our other posts.

Now this works with many other languages besides CSS.The other supported languages are:

  • cpp
  • csharp
  • css
  • delphi
  • html
  • java
  • jscript
  • php
  • python
  • ruby
  • sql
  • vb
  • xml

For more detail on how to add use this functionality in your blog read this post:

http://faq.wordpress.com/2007/09/03/how-do-i-post-source-code/

Enjoy!