• Hi, you know in admin under posts it shows you at the top a number under the word Published based on how many have been published. And if you hit delete on 1 it automatically updates that number or if you add a post it updates it.

    Is there a way to display that number on the front of my blog? As all my posts are videos I want to show how many published videos there are like

    1,456 Videos online

    Then as more are added it would show the update or deletion in the numbers

    There must be an easy way to do it as it exists inside the admin area for published number

    anyone know the code i would insert

Viewing 1 replies (of 1 total)
  • Thread Starter eddyj

    (@eddyj)

    Found it dont worry here it is for others

    <?php echo $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post'");
    if (0 < $numposts) $numposts = number_format($numposts); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Display Total Number of Published Posts’ is closed to new replies.