Posting Source Code in WordPress

This is so simple that it’s easily overlooked. Wrap your source code in [sourcecode] tags. Add a language element for specific styles.

Reference: http://en.support.wordpress.com/code/posting-source-code/