Queried Post Count for Year – How to Do Other Post Count Queries?
This Year <?php echo $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND <code>post_date</code> > '" . date("Y") . "-01-01 00:00:00'"); if (0 < $numposts) $numposts = number_format($numposts); ?>
That code queries the post count for the current year.
I’ wondering how to do it for day then week then month?
All help is highly appreciated. I am an absolute PHP noob and totally surprised I actually go this far.
- The topic ‘Queried Post Count for Year – How to Do Other Post Count Queries?’ is closed to new replies.