Category Archives: Computers

Adding Google’s +1 to WordPress with Twenty Ten

I added Google’s new +1 button to this blog with relative ease, but then found out it didn’t work! I must admit I was a bit lazy and didn’t follow the instructions to the letter, but it appeared to be working with the button added to the bottom of each post on the main page and on a single post’s page. Then someone pointed out they were getting an error, oops!

Since I made a mess of adding the +1 button I thought I should share what I did incorrectly and the correct way to get it working with WordPress using the default “Twenty Ten” theme.

What is Google’s +1 Button?

The Google +1 button for websites was only launched at the start of June, 2011. It is still early days and therefore difficult to determine the full implications of the +1 button, so I’ll just give the basic information here, rather than predicting what the future holds.

The idea of the +1 button is similar to Facebook’s like button, which I have also added to this site. That is, you can show your friends and contacts which things you find interesting on the web such as a web page, a video, a search result or even an ad. Google’s +1 button also integrates with Google’s services, enabling you to see +1 information in both the search results and on advertisements. There is also integration with non-Google sites to help customize content and ads.

None of this will work without your own Google account and if you want the non-Google site integration you have to change a preference setting in your account information. If you already have a Google account you can go to your account preferences where you should see an option to edit “+1 on non-Google sites” under the “Personal Settings” section. Once you click the edit link it will take you this screen:

Google +1 PreferencesNotice that it is set to “Disable” by default (a sensible policy!), so you need to “Enable” it to get the full integration with non-Google sites. I’m not quite sure what they mean by “personalise content” other than showing which friends actually clicked on the +1 button instead of just the numbers of people who have clicked on it (as shown in the image above). In any case I have enabled the option to see what happens.

If you want your contacts to be able to see which +1 buttons you have clicked on you need to make some adjustments to your Google profile too. You should see a “+1” tab on your profile page where you can set the preference to keep it private or to make it public. Here is mine:

Google +1 Profile TabYou can see that my preference is set to private (“This tab is only visible to you.”). You can change this preference by editing your profile which will show you the following screen:

Google +1 Profile Tab Preference ChangeI haven’t changed this preference yet. I didn’t even know I had a Google profile before I started reading about Google’s +1 button! 🙂

Here are some handy links if you want to know more: Google’s +1 Page, Google’s Profile Information Page.

How to get the Code?

I actually had some information appear on my Google Adsense dashboard about the Google +1 button which took me to the correct page to get the relevant code. You can also go directly to the main configuration page which allows you to change a few options before getting the final code.

Google +1 Button ConfigurationAs you can see above there are two main cope snippets that you need to use. The first is the Javascript code reference and the second is the code to make the button appear.

How NOT to Add the Google +1 Button to WordPress!

I was lazy and thought well I wonder what happens if you just copy and paste the code into the loop.php and loop-single.php, even though it says to put the script tag in the <head> section or just before the </body> tag. Well it worked, or so I thought. The button appeared in the correct place and I was quite chuffed with my efforts, so I went and added the Facebook like button too. I didn’t test the button because I thought it would be a bit lame to click on my own website. In hindsight I probably should have!

I was talking to my stepfather this morning and showed him what I had done, as he has a couple of blogs that he is working on too. He was curious and decided to click on the Google +1 button which ended up with the +1 button turning red in anger with an “!” in the middle of it. I tried it too and then faced the same problem.

Time to RTFM!

How to Add the Google +1 Button to WordPress!

Funnily enough, if you actually follow the instructions that Google provides then not only will the +1 button appear on your blog, it will actually work too! 😉

I put the script tag just before the </body> tag by editing the footer.php file. Depending on where you want the +1 button to appear you can then edit the other files as appropriate. For example, if you just want to have the +1 button appear on your single post pages then you only need to edit the loop-single.php file.

I decided to put it on both my main page, after every post, and on a single post page. This meant I had to edit both the loop-single.php file and the loop.php file.

To edit the “Twenty Ten” theme you need to log into your dashboard screen, click on Appearance and then select Editor. This will normally bring you to the stylesheet file by default. The other files you need to edit are listed on the right hand side.

First off, select the footer.php link and put the first code snippet just before the </body> tag, like this:

Wordpress Theme Editor - Footer

Now select the loop-single.php link and insert the second code snippet like this:

Wordpress Theme Editor loop-single.php

It’s the same for anywhere else you would like to put it, so just edit the relevant file and insert the code where you want the button to appear. You could also put the code in a widget if you so desired.

Conclusion

Google is introducing more social networking features to try and keep up with Facebook. The +1 button looks like it might be a useful tool for both web users and webmasters, but time will tell.

There are probably better ways of adding the Google +1 button to WordPress with the Twenty Ten theme, such as using custom functions, but this works for what I needed and I hope you find it useful too!

 

Emotiva LMC-1 as a DAC and Amplifier for my Computer

My Emotiva LMC-1 processor has been sitting in its box since I upgraded to the Emotiva UMC-1 processor. I was thinking about selling it, but then I had a fantastic idea! I had a spare set of Genesis IM-5200 speakers sitting in the bedroom (which my wife was telling me to sell), so why not use the Emotiva LMC-1’s built-in amplifier to power some decent music in the study by connecting my home computer to the Emotiva LMC-1?

The first thing to check was if the speaker stands and speakers would fit on top of my desk. It’s not ideal placement, but hey one has to improvise! The stands were a tight fit, with the left one looking a bit risky, but I put the speakers on top of the stands and everything seemed sturdy enough. With the stands locked in place by the constraints of the computer monitors the speakers had to be placed right back against the wall, so speaker cables with banana plugs were out.

I delved into the ever important box of “useful cables and things” and pulled out a coaxial cable to connect my computer’s coaxial out to the DVD input on the Emotiva LMC-1. There was also a pair of speaker cables that were just the right distance when I did a quick spot check of where everything should go.

I had to change the power cord on the Emotiva LMC-1 because it wasn’t quite long enough and since it’s an American plug I needed a free universal socket, of which there was none. I had to pull out a monitor that I use for my network router computer to get a free UK style socket. Luckily the network router computer only needs a monitor when I upgrade the software on it, so it’s not a big problem.

Then it was time to push the power button and hope the beast would come to life. Nothing! I had forgotten to flick the switch at the back of the Emotiva LMC-1 ;). The power-up sequence proceeded with no drama, so I was happy that the Emotiva LMC-1 was still working after its rest in the box.

I’d always configured the Emotiva LMC-1 using the on screen display (OSD), but now I had nothing but the front panel to play with. Luckily it was relatively straight forward to work out how to change the DVD input to use coaxial for audio. Then I had to work out how to make adjustments to the “Zone 2” configuration.

That proved to be a bit tricky. When I set the 2nd Zone to have the DVD input I could only get what appeared to be crosstalk coming out of the speakers at maximum volume (it was a whisper). I switched the input to Tuner and there was clearly enough power coming from the Emotiva LMC-1’s built-in amplifier to power the speakers. I checked the manual, but couldn’t see what I’d done wrong. I decided to try the “Sync” input for Zone 2, which syncs the main input with the Zone 2 input, and it worked!

One thing I have to be aware of is that Zone 2 will remain active, even when the Emotiva LMC-1 is turned off. This means the amplifier is on and more electricity is being drawn than what you would think of a product in standby mode. I can turn off Zone 2 before putting the Emotiva LMC-1 into standby mode, but I think I’ll just used the on/off switch at the rear.

The improvement in sound quality from my previous desktop speakers is, as you would hope, massive! Now I don’t have to sell my Emotiva LMC-1 or the Genesis speakers.

Starhub’s Home Zone Works on Fibre!

I recently posted on Solving Mobile Phone Reception Problems with Femtocell Technology, specifically Starhub’s Home Zone service. I now have an important update regarding the use of my fibre internet connection with the Home Zone service.

Starhub called me to let me know that they would like to terminate my Maxonline service (internet over cable) as they have resolved the compatibility problems with Maxinfinity (internet over fibre) and the Home Zone service (femtocell). While I was happy with the news, I asked Starhub if I could please test the service for a while to make sure it worked well. They agreed to get back to me after the specified time to confirm that everything was working correctly.

I’m happy to report that the Home Zone service is working well on the Maxinfinity service with no problems at all since changing over. I’d have to say that the service is very stable now when compared with my initial experiences. I’m happy to recommend it to anyone who wishes to solve their mobile phone reception problems.