How to highlight code syntax in WordPress

WP-Syntax is the answer.

For example, this is how I highlight an iPhone’s Objective-C code in this post.

- (void)viewDidLoad   
{    
    [super viewDidLoad];    
    NSString *title = [NSString stringWithFormat:@"My %@ syntax", @"AWESOME"];    
    self.title = title;    
}

 
To use WP-Syntax, simply surround the code with <pre lang=”LANGUAGE”> and </pre>, where LANGUAGE is the programming language.

To find out what to use for LANGUAGE, look under supported languages here.

If you like this, share it:
  • Facebook
  • Twitter
  • Google Bookmarks
  • Digg
  • del.icio.us
  • email
  • RSS
  • DZone
  • http://topsy.com/trackback?utm_source=pingback&utm_campaign=L2&url=http://just2us.com/2010/05/how-to-highlight-code-syntax-in-wordpress/ Tweets that mention Just2us » Blog Archive » How to highlight code syntax in Wordpress — Topsy.com

    [...] This post was mentioned on Twitter by Junda Ong, txeet. txeet said: How to highlight code syntax in WordPress – WP-Syntax is the answer. For example, this is how I highlight an iPhone… http://ow.ly/17sJKl [...]