WordPress Syntax Highlighter
| Posted by watashii | Filed under WordPressWhile trying to find a way to syntax highlighting / autoformat programming code on WordPress, I came across this. After a while, I realised it only works for WordPress hosted page. To enable syntax highlighting on a self hosted WordPress blog, you need to install the Google Syntax Highlighter plugin.
Here are the installation steps:
1) Download the plugin zip file.
2) Extract plugin into /wp-content/plugins directory.
3) Activate the plugin.
4) When posting, use the HTML editor and insert the following code:
<pre name="code" class="sql">
select * from tab;
</pre>
5) Hopefully looks like:
select * from tab;
The google documentation for using the syntax highligher is available here.
Tags: form, highlight, highlighter, source code, syntax, WordPress