WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a self-hosted Wordpress Blog (located at http://www.dougmolineux.com/wp if you're interesed :)

I put a lot of Code Snippets on there, because I'm a programmer. How do I make these "snippets" code friendly? Right now, I am using a simple Blockquote around each one and it converts all single and double apostrophes into strange symbols that will not work when the code is actually copied and pasted.

I am willing to convert to a new theme, or alter an existing one.


share|improve this question
up vote 4 down vote accepted



In general the Geshi library is a popular library for formatting code ( http://qbnz.com/highlighter/)

Geshi as a WordPress plugin

For WordPress several authors "packaged" Geshi in a plugin. take your pick: http://wordpress.org/extend/plugins/search.php?q=geshi

The one I use

Personally I use this plugin: http://wordpress.org/extend/plugins/codecolorer/. This one works by enclosing all pieces of codes with a [cc lang="bla"] code [/cc] tag where you can specify things like language, width, line numbering, etc…


geshi example

share|improve this answer
I highly recommend codecolorer, though I haven't tried Geshi. – prettyboymp Jan 11 '11 at 2:48
Thank you for you suggestion, I'll try this! :) – Doug Molineux Jan 11 '11 at 16:16

WP - SyntaxHighlighter Evolved

This is my favorite one, I had issues with others not processing the content correctly (despite being defined as the right language):




SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without losing it's formatting or making any manual changes. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev.


alt text

share|improve this answer

Both options mentioned above are good... but if all you need is to highlight syntax, you will probably need something less robust like the wp syntax it is compatible with wordpress up to version 3.5.1: as at the time of view you site, i noticed you're still running wordpress 3.3.1, dont worry, this will still work for you.

without line number

with line number

Works Fine with PHP, Ruby, Java and many other popular development languages

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.