WordPress SourceCode Tag And Themes

17 01 2008


1. Sourcecode tag in WordPress
2. Not for all Themes


1. Sourcecode tag in WordPress

Many of you already know that there’s this cool tag in wordpress allowing us to post code without worrying about formatting:

[ sourcecode language=’css’]…[/sourcecode]

In fact it takes care of syntax highligthing as well as preserving good indentation, like in the following example of a CSS rule:

.Test
{
    background-image:url('/images/Bckgrnd.jpg');
    background-color:#FFFFFF;
    border:solid 1px #7E7E81;
    cursor:pointer;
}

The supported language codes are:

  • actionscript3
  • bash
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp
  • diff
  • groovy
  • javascript
  • java
  • javafx
  • matlab (keywords only)
  • objc
  • perl
  • php
  • python
  • powershell
  • r
  • ruby
  • scala
  • sql
  • vb
  • xml

You can find info at the following link:

How do I post source code?


2. Not for all Themes

What you may not know is that this feature does not work with all the themes available, for example it doesn’t work with the default wordpress theme: Kubrick.

Hope this is a useful info for people trying to make it work right now.

→ go to top








%d bloggers like this: