Formatting Code in WordPress

http://support.wordpress.com/code/

Wrap your code in these tags:

[sourcecode language=’css’]

your code here

[/sourcecode]

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.

example:


string test;
class cls = new class;

string[] stringArray;

Advertisements