Tutorial Total Posts dan Total Comments

Assalamualaikum ..


Ada request macamana nak buat total post dan total comments dalam blog. Senang je ni. Korang kena guna Add a Gadget. Mula-mula sekali Tia nak minta maaf sebab Tia tak tau dan tak ingat dari mana ambil widget ni.




Haaa, atas ni adalah gambar printscreen yang Tia buat supaya korang tau widget apa yang Tia maksudkan. Widget ni akan nyatakan berapa jumlah entri yang korang dah post dan berapa jumlah komen yang korang terima.


Hebakk? Hahaa! Okey jom buat..

Step: Pergi Design > Page Elements > Add a Gadget > Pilih HTML/JavaScript dan masukkan code di bawah..

<script style="text/javascript">
function totalPosts(json) {
document.write('Total Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
function totalComments(json) {
document.write('Total Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
</script>
<script src=" /feeds/posts/default?alt=json-in-script&callback=totalPosts"></script>
<script src=" /feeds/comments/default?alt=json-in-script&callback=totalComments"></script>

Mudah kan? Tak payah main edit HTML. Selamat mencuba!
Sekian...
Previous
Next Post »

18 Comments

Click here for Comments
K
admin
July 29, 2011 at 4:39 PM ×

wah wah. hehe :P

p/s : hari ni lepas geram ke update banyak-banyak?? XD

Reply
avatar
Firdaus Life
admin
July 29, 2011 at 4:53 PM ×

cayalah tia.. tapi freaky x mau tayang. hehe kasi rasia :P

Reply
avatar
BeloG MTT
admin
July 29, 2011 at 4:53 PM ×

Menjadi ! Thanks Tia.. :)

Reply
avatar
Anonymous
admin
July 29, 2011 at 5:25 PM ×

baru je nak tanya pak cik google... ha3

Reply
avatar
arituarini
admin
July 29, 2011 at 5:28 PM ×

ok tq tia..

tia de masa nnt bleh tlong edit kn blog sy tk kih kih kih.. nak jugak ubah blog tu..tp tk tau..kih kih kih..

Reply
avatar
Munn Jaafar
admin
July 29, 2011 at 5:52 PM ×

erm....rjn tia share ye...cuma kalau blog yg pkai intense mcm blog Munnafendy xbkesan pkai cara ni... =)

Reply
avatar
Unknown
admin
July 29, 2011 at 5:55 PM ×

bro dah pasang kt blog tia..nak kejar tia lagi 50 entri..tia akan bro pintas hahaa

Reply
avatar
July 29, 2011 at 6:00 PM ×

yeay dah jadi...thanks Tia...Semalam ada gak buat tapi tak jadi pon...geram

Reply
avatar
Anonymous
admin
July 29, 2011 at 6:42 PM ×

thanks tia.. nk try lah...

Reply
avatar
Unknown
admin
July 29, 2011 at 6:59 PM ×

tia ,, senang je..tutor ne..thanks you..so much..daa kuar kt blog,,weee

Reply
avatar
Unknown
admin
July 29, 2011 at 7:25 PM ×

wam, nnt ade mase nak letak ni..

Reply
avatar
Wanie
admin
July 29, 2011 at 7:40 PM ×

hehe..wanie tak penah tau ade kod ni..
nanti boleh try..

Reply
avatar
safurara
admin
July 29, 2011 at 9:21 PM ×

akk malas nk edit html,nt hilang sume.hehehe

Reply
avatar
me
admin
July 29, 2011 at 9:26 PM ×

yeay ! sya da ada ! :DD

Reply
avatar
Aisyah Aina
admin
July 29, 2011 at 9:58 PM ×

dah banyak post tia..kita punya sikit je..kena rajin la lepas ni :D

Reply
avatar
Abu Bagi
admin
July 29, 2011 at 10:36 PM ×

wah aku mau try buat..berapa konon aku punya total komen sma total post hahahaha

Reply
avatar