As part of this blog, and my plan to continually update the template and theme code, there'll be a number of occasions when I'll want to publish and share code examples and the modifications I'm making.
Frustratingly, this is hard to do in a user-friendly and helpful way without the addition of a plugin to render and present the code in an aesthetically and easily shared copyable manner.
As such, I've installed SyntaxHighlighter Evolved, one of many 'Syntax Highlighter' plugins available in the repository (which tend to be based upon Alex Gorbatchev's JavaScript package). The plugin allows me to easily add wrapping tags to code which I enter in the post editor, which results in nicely formatted, functionally enriched and shareable code snippets - producing something like this:
session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}
I'll be using this plugin periodically to reference the code for changes or additions I'm making to the site. At some point, I'd like to review other solutions and to potentially develop my own, as I'm not keen on it outputting two script files, a css file and a significant amount of inline code into my blog's header!
