Created
August 21, 2012 21:27
-
-
Save Viper007Bond/3419572 to your computer and use it in GitHub Desktop.
WordPress Stats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once( 'wp-load.php' ); | |
$data = array( | |
'posts' => wp_count_posts( 'post' )->publish, | |
'pages' => wp_count_posts( 'page' )->publish, | |
'categories' => wp_count_terms( 'category' ), | |
'tags' => wp_count_terms( 'post_tag' ), | |
'comments' => wp_count_comments()->approved, | |
'attachments' => wp_count_posts( 'attachment' )->inherit, | |
); | |
$output = "<ul>\n"; | |
foreach ( $data as $label => $value ) | |
$output .= "\t<li>" . number_format( $value ). " $label</li>\n"; | |
$output .= '</ul>'; | |
echo '<pre>' . esc_html( $output ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment