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;
}

31 Responses to “Customizing Wordpress: failing SK2 captchas and a clickable logo”

  1. Jeroen Leenarts Says:

    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. :P

  2. Kraig Grayson Says:

    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.

  3. estetik Says:

    Very useful info for me. Thanks a lot.

  4. Lesishu Says:

    I used Akismet and Karma! Like them both! Thanx for the site!

  5. Beijing Car Rental Says:

    Very useful tips… glad I ran across this!

  6. Good Articles Says:

    Thanks. yes, sk2 is a great plugin.
    Akismet present error in judgment sometimes.

  7. ofertas Says:

    Great tips.

  8. dizi izle Says:

    I used Akismet and Karma!

  9. Ty Lombardi Says:

    Great tips. Your blog is very helpful. Thanks a lot!

  10. Homevisions Says:

    I used Akismet only. It woks well for me.

  11. Airbrushed License Plates Says:

    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

  12. second hand vans Says:

    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.

  13. Water4Gas Says:

    Spam Karma is a good plugin however it isn’t very effective. From my experience it can’t catch some spam comments…

  14. buy metal detectors Says:

    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!

  15. lowering springs Says:

    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.

  16. Alex Says:

    Interesting post thank`s to author.

  17. Andy Smith Says:

    Thanks for the tip, Ive been searching for something like this for my blog.

    Cheers

  18. fluoxet Says:

    prozac and pregnancy

  19. webmaster Says:

    Thank you for the nice post. I liked also your theme colours.

  20. sohbet Says:

    its good i will use it thanks a lot.

  21. Estetik Says:

    Thanks for your great help!

  22. Tom Says:

    Ive used SK2 so far with no problems. Works great so far (knock on wood).

  23. Metal Detectors For Sale Says:

    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.

  24. Jeremy Says:

    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.

  25. zcerkg_20 Says:

    Hmmm, I am tempted to try this.

  26. Burun Estetiği Says:

    Thanks for your great help!

  27. Lobo Iberico Says:

    Very nice tip, I’m gonna try it in one of my blogs.
    Tanks

  28. Leonardo Medina Says:

    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).

  29. kurye Says:

    thank you very much

  30. Estetik Says:

    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?

  31. rich Says:

    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.

Leave a Reply