Formatting Code in WordPress

Wrap your code in these tags:

[sourcecode language=’css’]

your code here


Any of the following can be used for the language parameter (using one is required):

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

Code in between the [sourcecode] tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.


string test;
class cls = new class;

string[] stringArray;