How To Display Blog Statistics Like This Blog? Comment afficher les statistiques blog comme ce blog?
This blog displays statistics on the right-sidebar (bottom) like - There are currently #### posts and #### comments in this weblog. The data is obviously dynamic. Ce blog affiche des statistiques sur la barre latérale de droite (en bas) comme - Il ya actuellement # # # # postes et # # # # de commentaires dans ce weblog. Les données sont évidemment dynamiques.
Andre recently asked me how I do it. Andre récemment m'a demandé comment je le fais. Here is a simple solution. Voici une solution simple.
Embed the following code in your sidebar (or elsewhere) in location of your choice: Intégrez le code suivant dans votre barre latérale (ou ailleurs) dans l'emplacement de votre choix:
get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = ‘publish’"); if (0 < $numposts) $numposts = number_format($numposts); $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = ‘1′"); if (0 < $numcomms) $numcomms = number_format($numcomms); ?> get_var ( "SELECT COUNT (*) FROM $ wpdb-> des postes où post_status = 'publie'"), si (0 <$ numposts) $ numposts = number_format ($ numposts); numcomms $ = $ wpdb-> get_var ( "SELECT COUNT (*) FROM $ wpdb-> Remarques éventuelles comment_approved ='1 ' "), si (0 <$ numcomms) $ numcomms = number_format ($ numcomms);?>
There are currently Il ya actuellement posts and postes et comments in this weblog. commentaires dans ce weblog. Enjoy! Apprécier!
You can also Vous pouvez également download the code(recommended) télécharger le code (recommandé) .
Note: Make sure to copy paste exactly the code above. Note: Assurez-vous de copier coller exactement le code ci-dessus. You may modify the message as indicated. Vous mai modifier le message comme indiqué.
Note: This code has been adapted from WordPress Note: Ce code a été adapté de WordPress Dashboard Tableau de bord code.
Filed under Classé sous CMS Software Logiciel de CMS , Headline News Headline News , How To Comment , PHP , Pro Blogging Blogging Pro , Tech Note Note technique , Technology Technologie , Web , Web Services Services Web , WordPress | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | cet article |
Email this Article Envoyer cet article
You may also like to read Vous mai également à lire |




December 10th, 2005 at 1:17 pm Décembre 10, 2005 at 1:17 pm
When I add that code to my sidebar.php file (right above the closing of the last div tag) thru the Presentation Theme Editor screen, it just errors out with that code to that spot at the bottom of my blog screen. Quand je ajouter ce code à mon fichier sidebar.php (juste au-dessus de la clôture de la dernière balise div) à travers le thème de présentation Sous l'écran, il suffit erreurs avec ce code à cet endroit en bas de mon blog écran. If I try to add it to the bottom of my sidebar.php file in Notepad, I don’t think it will work either, I’ll try emacs (anything else I should be aware of? Si j'essaie d'ajouter au fond de mon sidebar.php fichier dans le Bloc-notes, je ne pense pas que cela fonctionnera soit, je vais essayer emacs (tout ce que je devrais connaître?
December 10th, 2005 at 2:49 pm Décembre 10, 2005 at 2:49 pm
Sorry, I left the initial Désolé, je suis parti la première
December 10th, 2005 at 8:23 pm Décembre 10th, 2005 at 8:23 pm
Billy,
Please download the code (as indicated in the post) instead of copying from the display. S’il vous plaît télécharger le code (comme indiqué dans le poste) au lieu de la copie de l'écran. That should solve your issue. Cela devrait résoudre votre problème. Let me know how it goes. Permettez-moi de savoir comment cela se passe.