views:

134

answers:

4

I have an ancient version of Wordpress and its WYSIWYG editor really mucks up code examples in my blogs (removing lines and whitespace when saved, etc).

I wish to upgrade and install a theme/plugin that will make it easy to display code in a pleasant way.

Any suggestions?

A: 

Twenty Ten, which is the default theme bundled from WP 3.0+, is pretty good for displaying code. I'm using it at adamhopkinson.co.uk/zoophp

adam
+1  A: 

Many sites use Google Code Prettify for syntax highlighting on code, and people have developed wordpress extensions that make it easy to add GCP to a blog. Here's an example of one:

http://www.deanlee.cn/wordpress/google-code-prettify-for-wordpress/

Amber
+1  A: 

I recommend Syntax Highlighter Evolved. http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/

You can use shortcodes like [php] or [css] to contain your source code, and it will be rendered nicely when you view the post/page.

WordPress Hardcore
Believe that's what wordpress.com uses.
Michael
A: 

I recommend WP-Syntax. From the usage notes:

Wrap code blocks with <pre lang="LANGUAGE" line="1"> and </pre> where LANGUAGE is a GeSHi supported language syntax. The line attribute is optional.

windyjonas