CodeKeeper – free WordPress <code> block plugin
written by craig, 30 August 2007
WordPress is a great content management system and has a very good text editor. Unfortunately, it can try a little too hard to please and changes code samples so they get additional line breaks or paragraphs.
Our CodeKeeper plugin solves the issue. It retains the formatting of <code></code> blocks and converts any characters to HTML entities when necessary. It is useful for small snippets of code that do not require colour-coding, line numbering, or the other effects offered by more powerful syntax highlighters.
To install it, extract codekeeper.php to your WordPress wp-content/plugins folder, load the administration panel, and activate it in the Plugins section. You may also find it preferable to use the standard editor rather than the WYSIWYG one.
You can now use code examples directly into the editor, e.g.
<p>This is an HTML code snippet.</p>
You can also add CSS to the theme stylesheet to style the code sections, e.g.
margin: 1em 0 1.5em auto;
border: 1px solid #ccc;
You are free to use, modify, or distribute the software. An acknowledgment or link back to optimalworks.net would be great, and feel free to make a donation towards further development!