WordPress: Customizing WP-Syntax
October 23rd, 2009
I noticed a little bug in the WP-Syntax plugin for WordPress – the line numbers don’t match when using code with comments, well at least in Firefox 3.5. I realized it was caused by the italics where the line-height increased by approximately 1 pixel. It’s not that bad when you have a couple of comments in the code, but 60 lines of code with around 10 lines of comments completely broke my line numbers. I figured out WP-Syntax is configurable and here’s how I removed the italics from code comments:
add_action('wp_syntax_init_geshi', 'my_custom_geshi_styles');
function my_custom_geshi_styles(&$geshi)
{
$geshi->set_comments_style(1, 'font-style:normal;', true);
}
// Note that comments are okay now ;)
Place this in your functions.php file and refresh your page. More info about the other $genshi methods could be found in the Genshi Documentation.
This is the fastest and easiest way you can reach out to me. Just type in your message in the box below and click Tweet. If it's the first time you're tweeting via this form, you'll be directed to Twitter to grant access. Alternatively you can use my 












One Response to “WordPress: Customizing WP-Syntax”
Including pingbacks & trackbacks