WP-Syntax Colorizer
WP-Syntax is a fantastic WordPress plugin which automatically syntax-highlights source code in <pre> blocks for a large number of languages, using GeSHi. Unfortunately, styling WP-Syntax’s output can be a bit of a headache, particularly with regard to some undocumented functions.
I have put together WP-Syntax Colorizer, a WordPress plugin that gathers all of the work required to set custom colors for your code snippets, and you can simply run it alongside WP-Syntax. Customizing couldn’t be easier.
Example
The following code snippet has been styled with WP-Syntax Colorizer:
$query = "SELECT u_username, u_firstName, u_lastName FROM userTable"; $users = mysql_query($query); while($row = mysql_fetch_assoc($users)) { echo "<div class="user">"; echo "<strong>".$row['u_username']."</strong> <em>". $row['u_username']." "."</em>"; echo "</div>"; }
Installation
- Upload
wp-syntax_colorizer.phpto the/wp-content/plugins/directory. - Edit the colors in
wp-syntax_colorizer.phpto fit your needs. - Upload the modified
wp-syntax.cssinto the root directory of your theme, if you want to match a dark-colored theme. - Activate the plugin through the ‘Plugins’ menu in WordPress.
Where to get it
You can find a download link for the plugin here at WordPress.
About this entry
You’re currently reading “WP-Syntax Colorizer,” an entry on The Finishing Touches
- Published:
- 04.16.08 / 12am
- Category:
- Web Development
2 Comments
Jump to comment form | comments rss [?] | trackback uri [?]