All posts by blogadmin

How to Add the Google +1 Button to your WordPress

Yesterday, Google announced the launch of their much waited +1 button. This is a huge step towards adding the social aspects to the search results. In this article, we will discuss everything you need to know about Google +1 button including the step by step guide to adding it in your WordPress blog or site.

What is the Google +1 Button?

Google’s +1 button is a huge step toward adding social aspect to search results. It is a similar concept as Facebook Like button except it is for search results. In google’s word, it is your friend’s way of saying “this is pretty cool” or “you should check this out”. In another words, it is a public way of stamping something with your approval, so your friends, contacts, and others on the web find the best results when they search. This +1 button is currently available on English searches for Google.com.

Similar to the Facebook Like Button, Google +1 button will also show faces of your contacts (Gmail, Buzz, and Reader).

Why use Google +1 Button?

While Google has stated that this will not affect search ranking, in the interview with Mashable, Google rep Jim Prosser said this is something that the company is “very interested” in incorporating in some form at some point in the future. It is already true that when you are logged in to Google, you see different results than when you are logged out. We believe that this +1 button will certainly have a significant impact on search results in the near future even if the public announcement is not made. So it is best that you start using it right away and take full advantage of it.

We could only imagine this is something that will be added into the Google Banner ads and potentially in other social networks in the future.

How to Add Google +1 in WordPress

Google has created an official page for publishers which contains numerous sizes however there are some customizations that you may need to make if you are using WordPress. So follow the steps below:

Open your theme’s footer.php file and paste the following code above the closing of your body tag:

If you are using a theme framework in which case you will not have the footer.php file, then paste the following code in your functions.php file or custom functions area:

function add_googleplusone() {
echo ‘‘;
}
add_action(‘wp_footer’, ‘add_googleplusone’);

Once you have pasted the JavaScript, now open your theme file where you want to add the Google +1 Button. Most likely it will be your single.php file. Before you go ahead with this, there are numerous size options. Below is a reference guide:

The code to paste in your template for each size is below. Just copy the one that you like and paste it inside your post’s loop.

//Code to paste for the Tall Button

//Code to paste for the Medium Button

If you want to show the button without count, then you can add the parameter count=”false” in the code above. An example of the code should look like this (Note this does not work with the Tall size because it must have the count):

And then add the following code in your site’s footer below the script that we added in step 1. Example code should look like this:


We have already added the button on our site. Will you be adding / using it?

How to Add an Admin User to the WordPress Database via MySQL

Few days ago, we ran into an issue where a user’s site got hacked and their admin account was deleted from the database. This locked them out of their site without any other entry. We went in to the phpMyAdmin and created a new admin user to grant them access. In this article, we will show you a step by step guide on how to create an admin user in WordPress Database via MySQL.

Note: You should always make a backup of your database before performing any MySQL edits. This tutorial requires basic understanding of how phpMyAdmin works.

First, you need to login to phpMyAdmin and locate your WordPress database. (Below is a screenshot of a HostGator cPanel)

Once you are in, we will be making changes to the wp_users and wp_usermeta tables. Lets go ahead and click on wp_users table.

We need to insert our new admin user’s information, so click on the Insert tab like it shows in the image above. In the insert form, add the following:

* ID – pick a number (in our example, we will use the number 4).

* user_login – insert the username you want to use to access the WordPress Dashboard.

* user_pass – add a password for this username. Make sure to select MD5 in the functions menu (Refer to the screenshot below).

* user_nicename – put a nickname or something else that you would like to refer yourself as.

* user_email – add the email you want to associate with this account.

* user_url – this would be the url to your website.

* user_registered – select the date/time for when this user is registered.

* user_status – set this to 0.

* display_name – put the name you like to display for this user on the site (it can be your user_nicename value as well).

* Click on the Go Button

Next we are going to have to add the values to wp_usermeta table. Click on the wp_usermeta table and then click on the Insert tab just like the previous step. Then add the following information to the insert form:

* unmeta_id – leave this blank (it will be auto-generated)

* user_id – this will be the id of the user you created in the previous step. Remember we picked 4.

* meta_key – this should be wp_capabilities

* meta_value – insert this: a:1:{s:13:”administrator”;s:1:”1″;}

Insert another row with the following information:

* unmeta_id – leave this blank (it will be auto-generated)

* user_id – this will be the id of the user you created in the previous step. Remember we picked 4.

* meta_key – this should be wp_user_level

* meta_value – 10

Then click on the Go button, and you have created yourself a new username. Now you should be able to login to your wp-admin with the username and password you specified for this user. Once logged in, click on Users and edit the username you just created. Go down and click on the Save button (you don’t have to change anything). This will allow WordPress to go through and add some more information and clean-up the user we just added.

SQL query

For developers who want to speed this process up, you can simply drop this SQL query in your database.

INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (‘4′, ‘demo’, MD5(‘demo’), ‘Syed Balkhi’, ‘test@yourdomain.com’, ‘http://www.wpbeginner.com/’, ‘2011-06-07 00:00:00′, ”, ‘0’, ‘Syed Balkhi’);

INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘4’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘4’, ‘wp_user_level’, ’10’);

Remember to change the databasename to the database you are working with. Also don’t forget to change the appropriate values.

How to Add a Free LiveChat option in your WordPress Blog

I know, this is nothing new to many Internet users because thousands of websites selling products or services are already using live chat widget to be able to talk to their potential customers. When I first experienced this couple of years ago, I was very much excited about the concept and how it works. It is a definite way of increasing sales and building trust.

For instance, a live chat with Sales and Support team of my web hosting company saved plenty of my production time. Without it, I would have spent lot of time waiting in between writing tickets, emails and then waiting for support team to respond.

Background

I have a technology blog where some of the posts feature Drupal code related information & iPhone related information. Comments to these blog posts work but, they eat up time of the visitor who sometimes are looking for a quick help than commenting on the (partially understandable) feedback again & again.

I decided to experiment with having Live Chat option for my blog. I don’t need to or cannot be online 24×7
And to my surprise, I spoke to three visitors on the first day of the experiment. I had to prolong my day at work due to ongoing conversation but it was satisfying to know they got their issues resolved & doubts cleared.

It’s been ten days in to the experiment and I spoke to ten people so far. (Not bad!)
What it has done! What it can do!

The total number of Live Chat statistics might seem less but, it must have generated confidence about my blog within those visitors to whom I spoke to. They will possibly re-visit my blog or like my Facebook page.

This system can be more useful when there are more than one author. One can always remain online to help users solve programming issues or can even make a paid service to talk to the authors.

No just that, we can also offer this to our WordPress website clients.

By using this method, I am not revealing my email ID nor adding visitors to my contact list and still be able to talk to them.

How to? Without plugin

Live Chat without plugin can be achieved using Google Talk API. This is a great service from Google and we need a Google account to use it. This service is available free for personal account as well as for Google apps account.
It shows Online or Offline status based on your logged in status of Google Talk.

I have a personal Gmail account so I will showcase using the same.

Step 1: Go to Google Talk chatback badge website to create a new badge.
Or go to this page if you have Google Apps account. (replace DOMAIN with your own domain name without http & www)

Step 2: Click ‘Edit’ to change badge settings and style. This style will be visible on our blog. If your theme supports iframe then use standard style otherwise choose styles without iframe. I have selected without an iframe.

Step 3: Google creates different badge codes every time we visit above page. We can either disable previous badges we created or add a new one. It is important to copy the following HTML code on the page. (I have blurred some of the code for security reasons.)

http://cdn2.wpbeginner.com/wp-content/uploads/2011/06/live-chat-for-blog-04.png

Step 4: Go to your blog’s Widgets admin area. Create a new text widget in sidebar & paste the above code. Click ‘Save’.

Step 5: Check how it looks on sidebar. Above code can also be used on specific articles, pages or emails you sent out.

What happens next?

If someone clicks on this chat link, s/he and we (admin/executive) get a pop-up window. We can choose to join in to the chat by clicking on a link which will create a separate chat window. Getting a separate pop-up chat window is interesting than other on-page chat boxes because it gives clarity on multiple ongoing conversations.

How does it look?

See images of how it looks when you receive a chatback from user. First a window will pop-up letting you know a chat has been initiated by your user.

Upon you clicking, it will give you a launch window.

Lastly, a chat window will open where you can chat with your users.

How to? With Plugin

Using a plugin & a Google account above is relatively simple, but if you think its difficult or you do not have a Google account or feels like having more styles, features then you can choose using a WordPress plugin.

It would be too long to describe & use screen-shots for all such plugins while all of these have different set of instructions. I am compiling a list of FREE plugins in ascending order that I liked the most. You may choose that suits your needs.

List of Free Live-Chat options for WordPress Blogs

Below is a list of different plugin or non-plugin options for adding live chat functionality to your WordPress website. Some of these use your email ID and some use Admin logged-in events to determine your Online or Offline status.

Google Talk Widget

Features include:

* Multi-account fallback (when one goes offline, another available account will be used).

* Google Talk client is wrapped in a overlay widget.

* AJAX online status checking – visitors don’t need to refresh the page when you come back online.

* Customizable online and offline icons

* Customizable link for offline clicks (e.g. your contact form)

* Template tag and short-code available

* Online status caching for higher traffic volumes.

Custom Google Talk Chatback

Very similar to the one which we did without the plugin with features like:

* Custom “start chat link” and “offline text”. Use text or image.

* Display things depending on if the user is online or offline

* Widget, Short-code and Template Tag support

* Translatable (send them to us if you make any)

Yahoo Slide

Meebo Me is not a plugin, and it requires a free account. Interesting point is that they have iPhone and iPod application if you feel like connecting via your device.

Last Words

There are many PAID options available but I wanted to use a FREE option.

Advantage of Google or Yahoo Chat is that we would not require to login separately nor even on my blog to be able to talk to the visitors because I usually am online on gTalk most of the day time.

I hope you like this article. If you have any questions, please feel free to comment below.

How to Get Facebook Insights for Your WordPress Site

More than 10,000 new websites integrate with Facebook every day by using one of their social plugins. However most sites that we see are not taking full advantage of what facebook has to offer. Were you aware of the fact that you can get facebook insights for your WordPress site? These insights include data such as your most popular pages for the like button, send button, organic shares, comment box etc. It also includes information like who is your demographic audience on facebook, their age, gender, country etc. If you were not, then don’t be surprised because you are not alone. We checked some of the industry leaders’ websites including Chris Brogan, Brian Clark, Darren Rowse, John Chow, and Jeremy Schoemaker (aka Shoemoney) and none of their sites were taking advantage of Facebook insights either. In this article, we will show you how to get facebook insights for your WordPress site, so you can take full advantage of what facebook has to offer.

First thing you need to do is install our Facebook Open Graph Meta Data plugin. Once you have installed and activated the plugin, then go the Settings » FaceBook OG Meta tag and insert your facebook account ID. You can get your account id by visiting a URL like this:

http://graph.facebook.com/syedbalkhi < < Notice this must be your personal account ID. Not your fan page and not your app id. After you have setup the plugin correctly, your site is now ready for facebook. It will give facebook the correct thumbnail for the post, the correct title, the correct description, and most importantly it will tell facebook who is the admin of this site. Next thing you need to do is make sure that you are using the CORRECT version of the facebook like button. Many sites just utilize the iframe version of the facebook like button. While that works, it will not let you get facebook insights. You need to use the XFBML method shown in this post. Last step that you need to do is claim your site on Facebook. You need to visit the Facebook Insights Page. Look at the top right where the green button says “Insights for your Website”.

When you click on that green button, a lightbox will appear like the image below. Enter your domain name and make sure you link it with “YOU”.

Now when you visit the facebook insights page, you will see your website listed under Websites.

Once you click on your site, you will be able to access all sort of insights. An example image is below:

There you have it. Now you can easily get facebook insights for your WordPress site.