I’ve got a WordPress blog on WordPress.com. When posting something I’m including some sample Java code in the <code
tags, is there any way I can have this formatted better? Such as syntax highlighting and line numbers etc?
An example of what I have is here, even though I have the code tags it doesnt seem to make it any more readable than normal text
Am I limited in choices as I’ve gone for the free option?
wordpress.com supports code syntax-highliting.
You can read all about it here: http://en.support.wordpress.com/code/posting-source-code/
for your specific example use:
Yes you can. It’s
[code] *your code here* [/code]
and you can even hint the language:[code lang="php"]<?php echo 'test'; ?>[/code]
.This is the method I prefer (quick to write). There seem to be other ways as the following resource explains: Support: Code » Posting Source Code (wordpress.com)