Display how many post have been published today

<?php $today = date(“Y-m-d H:i:s”); //Today’s date $daysago = date(“Y-m-d H:i:s”,strtotime(date(‘Y-m-j H:i:s’)) – (1 * 24 * 60 * 60)); //Today – 1 day $numposts = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_date BETWEEN ‘$daysago’ AND ‘$today'”); if ($numposts >0) { echo $numposts.’ posts published today’; } else { echo “No posts published today”. ?>


post published today