Add Multiple Google +1 Buttons to WordPress

It’s recently been announced that the number of +1’s your site receives might affect your Google page rank so it’s worth having a Google +1 button on your site.

The obvious way to add a single Google +1 button is to just use a WordPress Google +1 plugin but what if you want to keep plugin numbers down for performance reasons or want to add multiple instances of Google +1 to your site, all promoting different url’s, ie – one at the top of your home page for your main site url and one on individual blog posts? Well this is what I needed to do and found it wasn’t that easy! Here’s how I managed it:

Go to www.google.com/webmasters/+1/button and grab your button code, making sure to enter a target url for your main site, then paste it into your site template, taking care to paste the right bits in the right places. The following goes in your header.php file in the <head> section:

<!-- Place this render call where appropriate -->
<script type="text/javascript">
  window.___gcfg = {lang: 'en-GB'};

  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

And the following goes wherever you want the button to show, typically inside the header.php file somewhere after the opening <body> tag:

<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline" href="http://www.reverbstudios.ie"></g:plusone>

Now, if you wanted to also have a button on each blog post, to specifically target that blog post url, you need to paste the above code into your single.php template file, somewhere inside the loop but this time change the url to “<?php the_permalink(); ?>”, ie:

<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline" href="<?php the_permalink(); ?>"></g:plusone>

What this does is automatically grab the post url of the post your’re currently reading and allows it to be +1’d!

See the top left of this site and the share section just below this blog post’s title to see both buttons in action.

Leon

Template Monster Sucks

I’ve had a nice little setup with Template Monster for a few years now. I sell their WordPress themes from my own site and use them for client projects and get a nice affiliate discount. The themes have always been fine and have been very handy for clients not sure what they need design wise. I just get them to browse the templates, pick one they like and I buy it and customise it for them. I collect my 20% discount when my account reaches $100.

The problems started for me when they decided to require database dumps to get the template looking the same as the one demoed, ie – you need to import a database to a fresh wordpress install via phpMyadmin or something similar. Not for the faint hearted. Otherwise, you face a massive job trying to re-create the functionality that was sold to you via the demo.

Lately, the quality of more than a few templates has been awful – to the point where the whole reason for using templates in the first place, ie efficiency, is compromised as you try to fix layout and css issues that result from even the most minor of hacks/customisations.

The latest issue I’ve had and the one that will probably mean me not using Template Monster again concerns a template that only works with a rather old and insecure WordPress 3.0 and not the latest version 3.2.1. After some testing in Internet Explorer 9.0, my client and I found issues with wordpress that meant we couldn’t use version 3.0 but when we tried 3.2.1, certain, very important parts of the template wouldn’t work.

I was pretty snookered and after weeks of bouncing back and forth in Template Monster’s support system, during which they done nothing but supplied useless information, never read what I’d already said and wouldn’t refund me, I’ve had to abandon the template and them along with it!

Leon

Switching From iPhone to Android

I’ve recently experienced a couple of switches from iPhone to Android with the purchase of a new Samsung Galaxy S II for me and a HTC Wildfire for my partner and one of my biggest worries beforehand was how we were going to get required data off the iPhone to the new Android devices, especially given Apple’s/iTune’s notorious inflexibility. A quick bit of research and a bit of jumping in at the deep end and everything was sorted fairly easily.

It’s worth noting that you can avoid a certain amount of hassle straight away if you were already syncing your iPhone with the likes of Google Apps which can sync Contacts, Email, Calendar, etc…

HTC WILDFIRE

HTC Wildfire S

Contacts

This was the first new phone to arrive and I was really impressed with the setup steps when first turning it on. The HTC prompted me to transfer stuff from my old phone via Bluetooth and even though iPhone’s useless Bluetooth can’t normally connect with ANYTHING, the HTC managed to pair with it and drag in all my partner’s contacts. But that’s all it took in unfortunately.

SMS/Texts

This turned out to be the trickiest one. We both had important texts we didn’t want to lose on our iPhones and were a bit stumped when we seen no obvious way of getting them onto the new phones. A bit of googling turned up this handy article Faked.org/isms2droid/ which explains how to locate your iPhone SMS backup file, convert it to XML and import it using the Android SMS Backup/Restore app.

SAMSUNG GALAXY S II

Samsung Galaxy S II

Contacts

Because this was my own phone and I was already syncing with my Google Apps account, setup was pretty damn easy. Pretty much the first screen you see when turning on the phone was the create or login to your Google account one and once I’d logged in, all my Contact, Calendar and Email information was synced with and added to the phone!

SMS/Texts

I had to go through the same process as for the HTC above to get my texts/SMS’s from the iPhone but I done it a lot quicker now that I was experienced! All texts and conversations were restored from the iPhone backup perfectly.

Media

The transfer of media such as Photos, Videos and iTunes Music was straightforward for both Android phones:

Photos

If you’ve been syncing iPhone photos to a particular folder on your computer then it’s a simple matter of connecting up the HTC via USB and just dragging them to the new phone. If you havn’t been syncing then you can just open the iPhone as a folder and copy the photos out of it then on to the HTC.

Music

Wasn’t sure whether the iPhone or iTunes would put some kind of protection on music downloaded from iTunes but it turns out it doesn’t. Simply locate your iTunes music folder on the computer and drag the music onto the HTC.

Conclusion

So the only thing we really lost from the iPhone were our apps but the ones we used most on are all available in the Android Marketplace, ie – Facebook, Twitter, Skype, Foursquare, etc..

PS – We’re both now delighted to be free from iPhone/iTunes limitations and be proud owners of 2 excellent next gen smart phones running on a much more refreshing and potentially much better Android OS.

Leon

 

Named and Famed – Some of my Good Clients!

Regular readers of stuff I put out on blogs and social networks will know I moan a lot about non or late paying clients so hopefully this post will balance things up a bit! This is a list of my best clients, clients who pay deposits up front and balances when required and who are professional enough to know how to do business properly. They are mostly repeat clients too.

PS – if you are a client of mine and not on this list, it doesn’t mean I hate you. I’m just taking a selection here!

Thanks guys.
Leon

Dodgy Client Storys

I’m not going to mention names here but I had to write this post to let people know the kind of things that go on with difficult clients in my business area, web & graphic design, and the kind of people in business out there at the min. If I wasn’t so badly affected, I’d be laughing… 😐

Case 1:

A former regular client with monthly bills who went without paying for about 4 months and left me in debt to the tune of about €700. Not once did I get paid by this guy on time having worked for him for years and he made me hand deliver printed invoices (16 mile round trip for me) then told me to come back some other time to collect a cheque! He told me on numerous occasions that he couldn’t pay because a pile of bills just came out of his account only for me to find out soon after that he was sunning himself abroad just after I talked to him.

Case 2:

One of my best ever clients financially but who would think nothing of ringing me 15/20 times a day or asking me to do his shopping for him on the way over for meetings. He once asked me to drop all my other clients and work exclusively for him! It was a real Boss – Employee situation. It felt like I sold my soul for his work and offloading him was a massive relief.

Case 3:

A local estate agent who gave me a spec and time limit both of which I adhered to exactly. I even got the site approved by people in his office but when I sent the final invoice all went quiet for months. I named and shamed and suddenly my work was under par and I got threatened with litigation. I took down the website but the client gained control of the .ie domain and site because I bought it in his name.

Regular issues:

  • Slow payments,
  • No Payments,
  • ‘Surprise’ at yearly hosting and domain renewal fees,
  • Slipping in extra work after acceptance of quote,
  • Projects with no end point,
  • Clients who can’t use email,
  • Clients going quiet for months mid project.
  • Blah, blah..

Leon

 

.ie Domain Price Reductions

There has been a recent reduction in the price of .ie web addresses by the IEDR and domain registrars have been passing this saving on to clients. I use a reseller to provide clients with domains and they’ve reduced the cost to me so I’m now reducing the cost to my clients from €28 per year to €24.95.

.ie addresses remain the best domain extension for your site if you’re an Irish company trading mostly in Ireland and .ie websites continue to perform well in Google Ireland searches.

Please note that some .ie renewals may still be charged at the old rate of €28 depending on when the renewal date falls.

Leon

Gravity Forms and WordPresss Custom Post Types

I’ve brushed by the problem of getting the Gravity Forms wordpress plugin to populate wordpress content a few times now and while it can handle basic post creation by default, with Title, Content, Images, Category, Tags, etc.. what if you need a front end form to create or populate a Custom Post Type and fill in the various bits of meta/taxonomy information that might be contained in that custom post type?

For one of my latest projects I’m building a property site and using an off the shelf template that comes with a custom post type called Listings which has contained within it custom fields and taxonomies such as:

  • Property Type,
  • No of Beds,
  • Location,
  • Price,
  • etc..

I figured initially that this should be easy enough but on researching found it wasn’t! Luckily the Gravity Forms + Custom Post Types plugin does pretty much all you need. Here’s how it works:

Install and activate the above plugin and go create a new Gravity Form as usual and add a new Title field from the ‘Post Fields’ section. This will be the title of the post and in my case, property name. Go into the advanced settings for that field and tick Save as Custom Post Type. The drop down box choice will list any custom post type created already. See below:

Custom Post

Next create either a drop down, multiple choice or checkbox field and go into the Advanced tab of the field settings and tick ‘Populate with a Taxonomy’, choosing your taxonomy from the resulting list. If you add a list of taxonomies to the custom post type in wordpress admin then these will be the values that populate that drop down/checkbox list on the front end when someone uses the form! See here:

Taxonomy

For this particular site I’m working on I can now have a client register an account, list a property (with ‘Pending’ status) and pay for the listing all through 1 form. Cool!

Leon