Many blog authors use plugins in WordPress to make their code samples look good. Code is generally written in most IDEs in a mono-spaced font, yet blogs are written in proportional fonts so code pasted in between blog text is usually very unreadable until you add a plugin to wrap the code samples in a mono-spaced font style.
There are a great deal of plugins available for WordPress which will make your code samples look good and the one I’ve started to use is called “Prettify GC Syntax Highlighter” (It had the highest rating!) The style is great but you can’t easily add captions to the code.