I use Akismet to keep spam off my blog here. It’s very effective. As you can see on the sidebar, it’s blocked more than 230,000 since I installed it. The problem I have is with the formatting of Akismet. It left-justifies a graphic on the sidebar and also it defines the graphical background (the blue box you see) as 120 pixels wide and 40 pixels tall. Here’s the two things:
- I want the box to be centered. When there’s a sidebar involved the way I’ve got most of my theme’s sidebars set up, left-justifying a graphic just plain looks bad. The graphic is even on the left side with my sidebar background. It just looks out of place.
- Even though the graphic is defined as 120 pixels wide and 40 pixels tall, the actual graphic is 120 pixels wide and 50 pixels tall. It never looks right on the roll-over. The lower corners are always “squared off”.
So rather than being a complainer and doing nothing but whining about the way it looks, I fixed it. For those of you interested in the fix, here it is. Note that the line numbers given are for Akismet version 2.2.6, the most current version at this time.
The changes need to be made in the CSS included in Akismet. The way Akismet is set up, you can use is as a plugin (for the newer versions of WordPress) or you can add it in to your sidebar manually (for the older versions of WordPress). Either way you will need to edit only two lines and they are identical. Lines 1053 and 1095 both originally read:
#akismetwrap #akismetstats{background:url(< ?php echo get_option('siteurl'); ?>/wp-content/plugins/akismet/akismet.gif) no-repeat top left;border:none;color:#fff;font:11px 'Trebuchet MS','Myriad Pro',sans-serif;height:40px;line-height:100%;overflow:hidden;padding:8px 0 0;text-align:center;width:120px}
Change both lines to read like this (changes in bold italics):
#akismetwrap #akismetstats{background:url(< ?php echo get_option('siteurl'); ?>/wp-content/plugins/akismet/akismet.gif) no-repeat top left;border:none;color:#fff;font:11px 'Trebuchet MS','Myriad Pro',sans-serif;height:50px;line-height:100%;overflow:hidden;margin: 0px auto 0px auto;padding:8px 0 0;text-align:center;width:120px}
And voilá! Now the Akismet graphic is re-assigned it’s original height and is centered on your sidebar! Technically speaking, this will work for any version of Akismet but the line numbers listed here are probably wrong for other versions.


















