Zack Live

Choose a Syntax Highlighter Plugin for WordPress

More and more codes have been added to my blog, I used to wrap my codes with quote, it’s not enough for long codes. I need a syntax highlight plugin for my blog.

I tested several syntax highlight plugins, including:

Here is my requirement:

  1. No modification, especially to my theme: I don’t want to make any change to my blog because of a plugin, especially change my theme.
  2. Syntax Highlight(of course) with line numbers: It’s much more easier to discuss or refer to particular line of code, if there are line number. WP-Syntax does not offer this by default, I know it can support line numbers with some easy tweak, but I am too lazy to do any modification, so WP-Syntax is out.
  3. Support WordPress Visual Editor: Some plugins do not support Visual Editor, every time I turn to Visual Editor, my codes changed and I need to fixed. This makes me crazy. As I remember, this happens to SyntaxHighlighter Plus, Google Syntax Highlighter for WordPress and Syntax Highlighter for WordPress. So I didn’t chose them.

The only one left is SyntaxHighlighter Evolved, it meets all my needs and works quite well after using for several weeks. SyntaxHighlighter Evolved supports most program language including PHP, CSS, HTML, C, Javacript. It’s very easy to use, just wrap your codes with “[languge]” and “[/language]” tags, language is the program language of the codes, like PHP. There is a Settings page coming with the plugin, you can find some usage instruction there. Here is an example of PHP:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>PHP Code Example</title>
</head>
<body>
	<h1>PHP Code Example</h1>

	<p><?php echo 'Hello World!'; ?></p>

	<p>This line is highlighted.</p>

	<div class="foobar">
		This	is	an
		example	of	smart
		tabs.
	</div>

	<p><a href="http://wordpress.org/">WordPress</a></p>
</body>
</html>

There are a lot of Syntax Highlight plugins out there, SyntaxHighlighter Evolved may not the best of them, but good enough for me.

Zack Live Free Resource. Zack Live Free Resource. Zack Live Free Resource

Related Posts