Tags

, ,

If you want to highlight the code/syntax when making yor comments/post in Drupal and WordPress, just wrap it with the following tag.
[sourcecode language=php]
// Your Code Here
[/sourcecode]

The above piece of code will be highlighted with PHP code format.

The language parameter controls how the code is syntax highlighted. The following languages are supported:
– actionscript3
– bash
– coldfusion
– cpp
– csharp
– css
– delphi
– erlang
– fsharp
– diff
– groovy
– html
– javascript
– java
– javafx
– matlab (keywords only)
– objc
– perl
– php
– text
– powershell
– python
– r
– ruby
– scala
– sql
– vb
– xml

Reference: WordPress.com – Posting Source Code

Advertisements