Site icon TheCreatology.com

How to add Google Like button in Thesis Theme WordPress ?

You must be aware of latest development by Google, that is New GLike Button for social media. Somehow, if you missed the story, you may read my article on New Google Like button for website. There are a lot of plugins which are already out to add Google like button in WordPress Blog. But, for people like who rarely depend on such plugins, will surely find this article, interesting. In the following article we will learn to add Google Like button in Thesis Theme WordPress.

But before we go ahead with the tutorial, I recommend you to update Thesis Theme. Don’t know how to do that ? Well, it is simple, just refer to article Safely upgrade to latest version Thesis 1.8 ? If you don’t have Thesis Theme Copy then you can also Download Thesis Theme.

Google Like Button for Thesis Theme

Add Google Like Button On Thesis Theme

When we talk of the custom coding, there are four variations of Google Like button developed to fit-in every layout of website. Google Like button in Thesis Theme can be added using thesis-hooks, the overriding functions. To show GLike button in single post, simply add  below code snippet in the custom_functions.php.

NOTE: Make sure you take full backup of custom_functions.php file using FTP before modifying it or you can also refer to the article about how to safely edit custom_functions.php


function joe_adds_glike_btn ()  {
if (is_single()) { ?>
<div style="float:right;">
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<g:plusone></g:plusone>
</div>
<div style="clear:both;"></div>
<?php
}}
add_action('thesis_hook_before_headline','joe_adds_glike_btn');

We’re Done

Once you have added above code in custom functions, you can now refresh your post page, where you will see Google like button in single post similar to screenshot below:

Google Like button in Single Post

For any social media button, I really like this placement and believe me it is effective. Now that we have added Google Like button in Thesis Theme, we are done with the tutorial. If you have any query or further assistance is required, post your feedback as comment below.

Exit mobile version