Syntax Highlight and Format Source Code in WordPress Posts

Code Snippet 2.0 helps you easily format source code with the correct style in WordPress.

If you use Windows Live Writer then this might not interest you much as WLW has a decent support for source code syntax highlighting. But if you use Mac and use one of those blogging clients then I’m sure you’d be struggling to get the source code formatted and highlighted properly. Since WordPress doesn’t support any source code formatting by default you need extra plugins to format the source code and make it syntax highlighted.

Out of the many plugins Code Snippet 2.0 stands out in its simplicity and the ease to get the code formatted appropriately. Code Snippet 2.0 uses GeSHi syntax highlighter engine which is a very flexible and easily extendable highlighter engine.

Also, Code Snippet 2.0 supports quite a spectrum of programming languages and so for the most part you should be covered if you use any of the languages below,

actionscript
ada
apache
applescript
asm
asp
bash
caddcl
cadlisp
c_mac
c
cpp
csharp
css-gen
css
delphi
diff
div
dos
d
eiffel
freebasic
gml
html4strict
ini
inno
java
javascript
lisp
lua
matlab
mpasm
nsis
objc
oobas
oracle8
pascal
perl
php-brief
php
python
qbasic
sdlbasic
smarty
sql
vbnet
vb
vhdl
visualfoxpro
xml

Usage is pretty simple,

Download the Code Snippet 2.0 plugin.

CodeSnippet folder.png

Extract the TAR file and copy the folder “codesnippet” to your local wp-content/plugins folder.

CodeSnippet folder under WordPress plugins folder.png

Upload the “codesnippet” folder to your hosts wp-content/plugins folder.

Code Snippet Plugin on WordPress.png

Enable the Code Snippet plugin on your WordPress Plugins page.

<code> tag in use.png” border=”0″ width=”418″ height=”214″ /></p>
<p>Once enabled, all it takes is to cover your source code with the code tag (substitute the language name appropriately) and your source code would be formatted appropriately with correct colors on your blog post.</p>
<p><img src=

If you’d like to have the line numbers listed on the source code then, go into your WordPress “Settings” and then to “Code Highlighting” and click on the “Show line numbers” checkbox. You can also adjust the styling if you are familiar with tweaking CSS elements.

I personally find Code Snippet 2.0 very easy to use and it does the job pretty decent. It doesn’t have too many options and flexibility but if you are looking for a simple plugin that can get the job done then Code Snippet 2.0 would be worth checking out.

Technorati Tags:
, ,

Related Posts with Thumbnails


Subscribe to our free RSS feed to keep up with what's happening at DemoGeek.com

At DemoGeek.com we try to explain the tech stuffs in as much detail as we can to help the not-so-tech-savvy of our friends understand and follow the tech stuffs.

Share/Save/Bookmark

Subscribe to DemoGeek.com

Leave a Reply





XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

3 Trackbacks/Pings

About DemoGeek.com

DemoGeek.com brings you high quality articles, tutorials and how to's on everything related to Microsoft Windows, Mac OSX, iPhone, Useful Websites, Browsers, Software and Programming.

At DemoGeek.com you'll find step-by-step explanation of the technical issues explained in detail with screenshots and screencasts. Read More...

Contact |  FUG |  Disclaimer

Creative Commons License

Canonical URL by SEO No Duplicate WordPress Plugin