You’ll notice, when looking at this blog, that I am new to the world of blogging. In only my second post, I pasted a command-line example, as text. I then noticed other bloggers (on WordPress to) have nice code boxes with the code syntax highlighted correctly.

I’ve used my skills on Google to no avail and would like someone to help me.

My blog is hosted on WordPress and I have tried the Windows Live Writer plug-ins also, but they pasted the html/css into the blog itself!

I realise nobody is actually reading my blog yet… but I can hope can’t I! I’ll continue to search for a solution and will post it here if I find one!

Neil

UPDATE:
So I have eventually found the answer, as you can see in my post here. I can’t believe it took me so long, but I’ve found out now and will be using it from now on!

Here’s how (taken from here):

Wrap your code in these tags:


your code here

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

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

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