Assalamu’alaikum and hello world~
This is just a simple tutorial for The Thesis Theme for WordPress user. I’ll show you how to add nice looking social sharing button at the bottom of each post just like mine? (See at the bottom of this post to see and try out the button.)
Wooot.. apehal aku speaking plak ari ni…?! LOL!
Okay, let’s straight to the point…
Firstly, go to Custom File Editor.
Then, all you have to do is simply place the following code in custom_function.php. Just put at the very bottom of custom_function.php and save it!
function fb_like() {
?>
<div class="fb-like"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=273645020698&xfbml=1"></script><fb:like layout="button_count" href="<?php the_permalink(); ?>" send="true" width="178" show_faces="false" action="recommend" font="arial"></fb:like></div>
<?php }
add_action('thesis_hook_after_post','fb_like');
function twitter_button() { ?>
<div class="tweetbutton">
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-text="<?php the_title(); ?>" data-url="<?php the_permalink(); ?>" data-via="[YOUR TWITTER USERNAME]">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div>
<?php }
add_action('thesis_hook_after_post', 'twitter_button');
function google_plus_one_integration() {
?>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<?php
}
add_action('thesis_hook_after_html', 'google_plus_one_integration');
function google_plus_one_output() {
if (is_single()) { ?>
<div id="g-plusone">
<g:plusone size=medium></g:plusone>
</div>
<?php }
}
add_action('thesis_hook_after_post', 'google_plus_one_output');
function linkedin_button() {
if (is_single()) { ?>
<div class="linkedin">
<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script><script type="in/share" data-counter="right"></script>
</div>
<?php }
}
add_action('thesis_hook_after_post', 'linkedin_button');
You must change the RED value to your own.
After done the above step, now place the following code in custom.css, and modify as desired to fit the look of your site and save!
.custom #g-plusone,
.fb-like,
.tweetbutton, .linkedin {padding: 13px 12px 12px 15px;border-radius: 4px;-moz-border-radius: 4px;-webkit-border-radius: 4px;}
.custom .fb-like{background: #ECEEF5;border: 1px solid #9DACCE;margin: 2px 0 0 0;float: left;padding: 10px 6px 7px 8px;width: 178px;}
.custom .tweetbutton{background: #E8F3F9;border: 1px solid #A4CCE5;margin: 2px 0 0 8px;float: right;padding: 10px 4px 4px 8px;width: 100px;}
.custom #g-plusone{background: #F9F9F9;border: 1px solid #CCCCCC;margin: 2px 0 0 8px;float: right;padding: 10px 3px 4px 8px;width: 66px;}
.custom .linkedin{background: #F9F9F9;border: 1px solid #CCCCCC;margin: 2px 0 0 8px;float: right;padding: 9px 3px 5px 8px;width: 96px;}
Now you’re done!
UPDATE!
The result you got if using my code above is, two of the button (facebook & twitter) will appear on the frontpage. Please use this code instead of the above if don’t want the button on the frontpage.
Only change this line:
function fb_like() { ?> <div class="fb-like"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=273645020698&xfbml=1"></script><fb:like layout="button_count" href="<?php the_permalink(); ?>" send="true" width="178" show_faces="false" action="recommend" font="arial"></fb:like></div> <?php } add_action('thesis_hook_after_post','fb_like'); function twitter_button() { ?> <div class="tweetbutton"> <a href="http://twitter.com/share" data-count="horizontal" data-text="<?php the_title(); ?>" data-url="<?php the_permalink(); ?>" data-via="[YOUR TWITTER USERNAME]">Tweet</a> <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </div> <?php } add_action('thesis_hook_after_post', 'twitter_button');
with this one..
function fb_like() { if (is_single()) { ?> <div class="fb-like"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=273645020698&xfbml=1"></script><fb:like layout="button_count" href="<?php the_permalink(); ?>" send="true" width="178" show_faces="false" action="recommend" font="arial"></fb:like></div> <?php } } add_action('thesis_hook_after_post','fb_like'); function twitter_button() { if (is_single()) { ?> <div class="tweetbutton"> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-text="<?php the_title(); ?>" data-url="<?php the_permalink(); ?>" data-via="[YOUR TWITTER USERNAME]">Tweet</a> <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </div> <?php } } add_action('thesis_hook_after_post', 'twitter_button');
For other type of themes, please refer tutorial from Ariffshah.com
akhirnya berjaya slps membuang beberapa plugin dan juga FB fan page box.. aku tak tahu samada ia ada kaitan ataupun tak.. tp lps buang baru semuanya OK! huhu.. TQVM bro
Azizwan recently posted..Gambar Kereta McLaren F1 Mr. Bean Selepas Kemalangan
hohoho… tahniah bro..
maybe ada kot tersangkut kat mana2 plugin.. hehehe…
aku buat tak jd2.. ada sekali jd, tp fan page box yg tunjuk kat blog tu error.. then tgk kat chrome & safari, dia berterabur.. last2 aku delete.. ada solution tak dan camne nak dpt appid tu?
Azizwan recently posted..Gambar Kereta McLaren F1 Mr. Bean Selepas Kemalangan
Hohoho.. aku lupe nak terangkan skali dlm post sbb secara purata aku tibai korang semua tau nak buat.. hahaha… x pe lah.. aku terangkan kat sini terus..
Easy way to get appId for fb-like button.
1. Visit http://developers.facebook.com/docs/reference/plugins/like/
2. Put whatever link in URL to Like (e.g., http://blabla.com) *Just to get an appId.
3. Press Get Code button and popup of the code should appear.
4. AppId is here: http://connect.facebook.net/en_US/all.js#appId=223390541040494&xfbml=1
yg tu ler aku dah ambil.. tp tak juga keluar2.. huhu.. jap aku try lg.. mungkin kena deactived plugin fb like tu dulu.. anyway tq bro..
nak main css ni yang fail ni… -.-, dah pasang dh pun
Kamil ace recently posted..Tahun Baru Hijrah
Thesis Tutorial #1 : Add Nice Looking Social Sharing Button http://t.co/dJ1OL8U via @mrbintang boleh cuba nie thanks..
Thesis Tutorial #1 : Add Nice Looking Social Sharing Button http://dlvr.it/dsLwt
[...] merupakan pengguna tema Thesis, korang boleh mengikuti tutorial khas untuk tema tersebut di blog Si Bintang. Jika korang bukan pengguna Thesis, korang boleh cuba cara yang aku akan tunjukkan ini. Oh ya, [...]
teringin nak pakai thesis theme..
sayacomel recently posted..Comel Sangat – Berehat.
dah lama tak pakai thesis
Fazreen recently posted..Tuesday Total Textures 9
wahhh..ade thesis tutor gakk…hehe..tp kalo kite buat group single post terus sume lagi mudah…bro blh share x?? emm ade contoh result x cmne?
thesis bro mmg mantop..cmne bro buat layout cmni?
Haru recently posted..Login Facebook Dapat RM100! 1 Hari 10xLogin Dapat RM1000!
err.. group single post camne tu ek bro? leh detail lg x? hehehehe…
dah jadi hahahahaha
andyhowtt recently posted..aku dan DSLR (Part 1)
Buat masa ini saya pasang plugin AddThis sebab masuk kod tidak menjadi
akubiomed recently posted..Wordless Wednesday #5- Angry Bird
Thesis Tutorial #1 : Add Nice Looking Social Sharing Button http://dlvr.it/b8bzP
Nak kena cuba ni.. Makasih
syok.my recently posted..Cicak Tokek Haram Dimakan – Majlis Fatwa Kebangsaan
hehehe.. cube jgn x cube.. :P
kepada yg telah mencuba tutorial ini tp x berjaya.. harap maaf.. ralat tersebut sudah diperbaiki.. sile cuba skali lg.…http://lnkd.in/pkJ7Pz
Thanks bro
dengan pantas ko buat tutorial ni
aku try buat dulu ek
wazy recently posted..Wordless Wednesday #7 : Tasbih
ok2… hehehe… kalau x jd gtau ek..
happy editing!
Mr.Bintang recently posted..Thesis Tutorial #1 : Add Nice Looking Social Sharing Button
Orite,aku dah dapat guna ,ccuma kena adjust css je
tq again bro
wazy recently posted..Perbezaan Antara Parked, Sub dan Add-On Domain
same² bro.. hehehe.. sorry, aku baru perasan ralat tu td.. haha..
Mr.Bintang recently posted..Thesis Tutorial #1 : Add Nice Looking Social Sharing Button
Baru perasan ada tutor ni.. sebelum ni buat main try and error jer… cuma yg facebook like tu, sy tak letak kod ni:
Emm, tak pe ke mcm tu?
Azuan recently posted..Aku Seorang Blogger
Hilang lak kod yg dekat komen td.. ni kod ni: div id = ” fb-root ” / div
Azuan recently posted..Aku Seorang Blogger
eh.. baru aku perasan ada sedikit keganjilan kat kod tu… huhuhuhu.. jap aku check-up balik..