Lee Kelleher

Posting source code on WordPress.com

Posted on . Estimated read time: under a minute (82 words)

I feel like a complete n00b … I’ve only just found out how to mark-up source-code snippets on WordPress.com

It’s in their FAQs: How do I post source code?

Essentially you use the short-code: [sourcecode language='css']...[/sourcecode]

Here’s an example:

// A "Hello World!" program in C#
class Hello
{
   static void Main()
   {
      System.Console.WriteLine("Hello World!");
   }
}

I knew about WP.org plugins that did this, but I’ve been scratching my head on how do this on WP.com for ages now!