Customizing Wordpress: failing SK2 captchas and a clickable logo
Well, I must say I’m quite pleased with Wordpress so far.
I did some customizations, and ran into some minor problems:
Spam Karma
I didn’t want to enable comments and pingbacks before I had some good spam protection. I have that now: Jeroen pointed me to Spam Karma 2. Although the installation and configuration were easy enough, I ran into one snag: it did not display captcha images correctly.
Using the old ‘telnet localhost 80‘ trick, followed by ‘GET /wordpress/wp-content/plugins/SK2/sk2_captcha_graphic.php‘, I discovered that the PHP script was generating the following error: ‘Call to undefined function: imagecreate()‘. This turned out to be caused by the fact that my server (Ubuntu 6.06 LTS) did not have the PHP bindings for the GD2 library installed. A simple ‘apt-get install php5-gd‘ solved the problem.
I added a note about this on the SK2 FAQ Wiki page which, rather ironically, seems to be plagued by spam (it’s sneakily hidden using some CSS tricks, so that people won’t see it but the links still contribute to the spammer’s PageRank). I took the liberty of removing the spam a couple of hours ago, but it has been added again already.
Clickable logo
And speaking of CSS tricks.. I used The Gimp to create a nice custom logo for my blog. OK, so it’s not particularly creative: I used the fractal renderer plugin to create a background, and then pasted the text on top of it using a couple of the standard “alpha to logo” plugins. The result is not too different from hundreds of other blogs out there, but at least it’s a change from the standard Wordpress default theme.
However, now that the text is part of the image instead of HTML-ed on top of it by Wordpress, it was no longer possible to get back to the main page by clicking on the logo! At first, I thought I could live with that, but it rapidly annoyed me more and more. And because the logo is technically a background image rather than an ordinary img element, putting a link on it was not completely trivial.
Fortunately, I found a nice CSS trick to make the logo clickable again, by setting the size and position of the invisible element so that they overlap the image exactly. This required some minor changes to my stylesheet file and to the header.php file of the Wordpress theme.
The relevant part of my header.php file now looks like this:
<div id="header">
<a xhref="<?php echo get_settings('home'); ?/">
<div id="headerimg">
<p>
<h1><?php bloginfo('name'); ?></h1>
<div class="description"></div>
</p>
</div>
</a>
</div>
And here’s the relevant part of my style.css file:
#header {
background: #73a0c5
url('images/kubrickheader.jpg')
no-repeat bottom center;
position: relative;
}
#header a {
position: absolute;
margin: 7px 9px 0;
height: 192px;
width: 740px;
}
#headerimg {
margin: 7px 9px 0;
height: 192px;
width: 740px;
}
#headerimg p {
display: none;
}
January 1st, 2007 at 5:19 am
Well, first of all. Happy new year to you Martin.
I’m here at my laptop back from a new years party. I thought I was wasted, but someon topped by examplart performance. Although I should not post while under the influence of alchohol… Well it does explain the idiotic hour I am writing this. (Which is 5:17 AM to be exact.)
I didn’t know about the ubuntu/SK2 issue you mentioned. But it is true, I am running on a shared hosted linux box. Nice to see I am able to post comments now. Because in my opinion a good blog entry provokes feedback from readers.
I’m of to bed now, going to take a good slosh of water, brush my teeth, hope I won’t have a huge hang-over and crash.
January 5th, 2008 at 4:56 pm
Hi Martin,
Thanks for the info on making the logo clickable. I tried it and it works. Great work man. Keep up the good work.
April 10th, 2008 at 2:26 pm
Very useful info for me. Thanks a lot.
April 22nd, 2008 at 6:37 am
I used Akismet and Karma! Like them both! Thanx for the site!
April 22nd, 2008 at 6:41 am
Very useful tips… glad I ran across this!
April 22nd, 2008 at 8:36 am
Thanks. yes, sk2 is a great plugin.
Akismet present error in judgment sometimes.
April 30th, 2008 at 12:36 pm
Great tips.
May 5th, 2008 at 9:17 am
I used Akismet and Karma!
May 9th, 2008 at 4:27 am
Great tips. Your blog is very helpful. Thanks a lot!
June 18th, 2008 at 9:07 pm
I used Akismet only. It woks well for me.
June 26th, 2008 at 1:11 am
I used to use SK2 exclusively until I saw how much easier Akismet is set up. I now run both which leaves me with no spam.
Thanks for the css tips. I still have a hard time understanding code, but hopefully i can make one of my blogs logo clickable instead of changing the entire theme.
Cheers,
Matt
July 31st, 2008 at 9:12 pm
I am no good at this kind of thing so thank you very much for putting this out. I will try this on my website and fingers crossed even I wont mees it up.
August 28th, 2008 at 9:31 pm
Spam Karma is a good plugin however it isn’t very effective. From my experience it can’t catch some spam comments…
August 29th, 2008 at 9:09 am
Hey, cool tips, thanks for the info. BTW I think Askimet is good, but sometimes it catches legitimate sites and content rich comments, and once you get the askimet, it’s nuts to try to get unaskimeted!
September 17th, 2008 at 12:55 pm
I think that is the power of CSS which allow us different alteration. For couple of other reasons, I don’t like Wordpress anymore and Have moved to Drupal. All Drupal code is editable because it is open source. Although Wordpress is also Open source but there are less technical guys out there.
September 22nd, 2008 at 3:02 pm
Interesting post thank`s to author.
September 25th, 2008 at 9:46 pm
Thanks for the tip, Ive been searching for something like this for my blog.
Cheers
September 30th, 2008 at 9:00 am
prozac and pregnancy
October 5th, 2008 at 6:36 pm
Thank you for the nice post. I liked also your theme colours.
October 6th, 2008 at 10:47 pm
its good i will use it thanks a lot.
October 7th, 2008 at 9:15 am
Thanks for your great help!
October 14th, 2008 at 7:59 pm
Ive used SK2 so far with no problems. Works great so far (knock on wood).
October 27th, 2008 at 5:58 pm
I have used SK2 as well. I have had no problems. However, on most of my sites I use Akismet. It is updated more often.
November 4th, 2008 at 11:26 am
I like the whole captcha thing and concept, just some of them don’t work very well, and they are hard to read. So I end up having to type something over because I couldn’t see the captcha well enough to make it out.
November 11th, 2008 at 12:14 pm
Hmmm, I am tempted to try this.
November 12th, 2008 at 2:39 am
Thanks for your great help!
November 24th, 2008 at 5:14 am
Very nice tip, I’m gonna try it in one of my blogs.
Tanks
December 11th, 2008 at 3:15 pm
I am also very please with wordpress because there is nothing easy to edit than it. I had used other blogging systems as well but it is really difficult to customize them(Most of them use smarty as their template engine and I am not good at that).
December 12th, 2008 at 9:36 am
thank you very much
December 12th, 2008 at 6:24 pm
Question though, lets say I wanted to display text to the right of the big image when I click on the thumbnail. Like, it would be a description of the picture. How would I do that?
December 15th, 2008 at 6:45 pm
Everyone welcome! A lot of useful and interesting information. I think this blog with its wonderful themes will be interesting and useful to a large audience. Topics blog will be useful to many readers. The author of RESPECT.