How do I add syntax highlighting to a WordPress blog hosted on WordPress.com?

http://stackoverflow.com/questions/1273647/how-do-i-add-syntax-highlighting-to-a-wordpress-blog-hosted-on-wordpress-com

On wordpress.com, you can’t install plugins, so you have to use WordPress’ built-in widget.

Do it like:

[code language='python']

[/code]

Note that those tags go inside your visual editor, not the HTML editor.

You can find more information here.

shareedit

SyntaxHighlighter is a pretty good tool. It uses JavaScript with CSS classes to mark HTML elements that should be highlighted. It also allows code to be copied to the clipboard and printed.

shareedit
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s