I came across a post about syntax highlighting for code in Wordpress on Thomas Roach’s blog who in turn saw it on Tyler Muth’s blog. There is a plugin called syntax highlighter which does all the beauty. Use is very simple:

Download it from here.

Upload to your blog’s plugins folder and extract it over there.

Now (on Wordpress) go to Plugins page and activate the plugin.

To use it wrap your code like

code.JPG

and you are done.

Wanna see, how does it look like ;)

[sourcecode language=‘css’]SQL>drop database;[/sourcecode]

Isn’t beautiful ;)

Comments

Comment by NeilC on 2008-03-07 05:30:27 +0530

Hi Amardeep

i’m new to blogging (starting today), and am trying to use WordPress, I have two questions

  1. Where do I find my blogs plugins folder ?
  2. Where (on WordPress) do I find Plugins page to activate the plugin?

many thanks

Comment by Sidhu on 2008-03-07 06:55:55 +0530

Hi Neil

Not sure if you have signed up with wordpress.com for a blog or registered your own domain name and trying to setup blog using wordpress software.

If its latter then:

1. Where do I find my blogs plugins folder ?

It will be in /blog/wp-content folder of your blog.

2. Where (on WordPress) do I find Plugins page to activate the plugin?

On your Dashboard go to plugins page and from there you can activate the installed plugins.

Hope that helps…
Sidhu