Google Ads & WordPress
If you’re a long time reader of the blog. Then you may have noticed that Google Ads have appeared on this blog.
I thought I would give them a try, even if they only create a small income it does help to pay for the servers.
My main issue is with them being discreet - I don’t want flashing adverts, animations and terrible colours making the blog look a mess. Okay, this isn’t the best looking blog in the world but I still don’t want it to annoy you the reader. So, I’ve opted for text only ads.
I was surprised how easy it is to set-up the adverts. You literally just run through a series of questions (set up your colour scheme if needs be) and then a section of code is output. With the ‘default’ WordPress theme you simply copy-&-paste this into your single.php file (displayed for single post view)…
<?php get_header(); ?>
<div id="content" class="widecolumn">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
...*exact* code from Google...
<div class="navigation">
<div class="alignleft"><?php previous_post_link(’« %link’) ?></div>
<div class="alignright"><?php next_post_link(’%link »’) ?></div>
</div>
…and the sidebar.php file (not show on single posts but is show on other views)…
<div id="sidebar">
...*exact* code from Google...
<ul>
<li>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
</li>
…job done.
I did have a major issue on the Mac though. For some reason my machine will not display the ads in any browser. I think it may be either a firewall issue or an issue with the JavaScript engine on the Mac. However, if I turn off the firewall it makes no difference. Odd.
Whatever the cause, it does make testing the pages on a Mac impossible (nothing appears) and I had to check them on my Windows laptop instead. This may just be my machine of course.
Update
I’ve tried viewing the web pages on my old Mac Mini and the ads appear. So, there’s definitely something funny going on with my PowerMac.
Another update
It looks as if this failure to display ads issue could be Safari 3 or a partly broken install of it on my machine.
I tried to install Safari 3 a few days after it was released but it didn’t work. It appears it failed because I didn’t close all the applications (particularly QuickSilver which uses the WebKit) before starting the install. As a result I was left with a half-way complete set up. Oddly, I could still run Safari 2 - which a lot of other people couldn’t - but I had issues. Namely the JavaScript seemed a bit broken.
I decided to reinstall Safari 3 beta but found it wouldn’t run. It appears that running the Disk Utility and “repairing permissions” solves this problem, well it did for me. So I quit all running applications and completed the install. It now runs as Safari 3 beta but I still don’t have working JavaScript.
Oh well, at least my Mac Mini’s Safari still works. I’ll just have to wait for an update on Safari 3 I suppose…



