How to to catch into a PHP variable the total number (an integer of course) of posts in the Blog (Sum of posts in all categories)
Something like this:
'<?php $total_posts = ???? ?>'
How to to catch into a PHP variable the total number (an integer of course) of posts in the Blog (Sum of posts in all categories)
Something like this:
'<?php $total_posts = ???? ?>'
Try this:
<?php $total_posts = $wpdb->get_var("select count(id) from $wpdb->posts"); ?>
Thank you pizdin_dim :-)
Works great!
This topic has been closed to new replies.