Blog Statistics


The Dashboard displays information about the number of posts, comments, and categories in your blog (Figure 8). You may want to share this information with your visitors. Fortunately, it's easy. You just copy some code from one file and paste it into another. Here's how you can put blog statistics in the footer.

Figure 8. The Dashboard displays basic blog stats.


To include blog statistics in the footer

1.

Open the index.php file in the wp-admin folder (not your theme folder) with a text editor.

2.

If necessary, display line numbers.

3.

Locate the text starting at line 100 and ending at line 110 (Figure 9) and copy it. This code counts the numbers of posts, comments, and categories and then displays the counts.

Figure 9. Select the code that will display the stats.


4.

Open the footer.php file for your theme with a text editor.

5.

Paste the copied text after this line:

<div >


6.

Save the footer.php file. The footer now includes code to count posts, comments, and categories and to display the count.

7.

View your blog to see the new information (Figure 10).

Figure 10. The stats appear in the blog's footer.





WordPress 2. Visual QuickStart Guide
WordPress 2
ISBN: 0321450191
EAN: 2147483647
Year: 2004
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net