News Update :
Home » » How to know the number of messages and the number of comments

How to know the number of messages and the number of comments

By: Unknown on Wednesday 4 February 2015 | 12:54

Pour savoir le nombre total de message et de commentaire de votre blog, suivez les etapes suivantes:

   

 Connectez-vous à blogger ----- Présentation>>Ajouter un gadget  puis HTML/Javascript
    Copier/coller le code suivant

 



<script style="text/javascript">
function numberOfPosts(json) {
document.write('Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
function numberOfComments(json) {
document.write('Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
</script>
<font color="blue"><script src="http://blogger-astuce.blogspot.com/feeds/

posts/default?alt=json-in-script&callback=numberOfPosts"></script>
<script src="http://blogger-astuce.blogspot.com/feeds/comments/

default?alt=json-in-script&callback=numberOfComments"></script></font>



Enregistrer votre widget et rafraichir votre blog pour voir les changements.


Personnalisation:

changer http://blogger-astuce.blogspot.com par l'adresse de votre blog

et pour changer Posts (en Anglais)par Messages(En francais),

il suffit de changer le mot Posts par Messages dans la ligne suivante :

document.write('Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');

et pour changer Comments(en Anglais)par Commentaires (En francais),

il suffit de changer le mot Comments par Commentaire dans la ligne suivante : 

document.write('Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');

Post a Comment

 
Contact Us | Privacy policy | Term of use | Advertise with Us | Site map
Copyright © 2011. Blogging Brain . All Rights Reserved.
Design Template by Blogging Brain | | Powered by Blogger