Since I’m quite new to WordPress it is a learn as-I-go process (sounds familiar huh?) and a major goal of this blog is to keep track of things so that I don’t forget them:
Including formatted code in your blog is easy, WordPress has a FAQ about it!
Basically it comes down to adding the sourcecode
shortcode and then make sure the language
attribute has the right value.
But there are some gotcha’s that are not in the FAQ:
- paste the
sourcecode
shortcode as “plain text” (or in the HTML editor) otherwise it will get span tags around it and not render as code - C# has
language
codecsharp
(if you use a non-existing language code, it will not render as code either)
The language codes I will probably use most are csharp
and delphi
, followed by xml
and sql
and maybe some css
and html
.
In your editor, you will then see something like this:
Read the rest of this entry »