tags:

views:

18

answers:

1

I finally got some code made for to output this years total published posts.

get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND `post_date` > '" . date("Y") . "-01-01 00:00:00'"); if (0 < $numposts) $numposts = number_format($numposts); ?>

I'm looking at the WP time paramters to try and make it also do day then week then month.

http://codex.wordpress.org/Function_Reference/query_posts#Time_Parameters

Can anyone advise me on what to do? Thanks

A: 

I think this thread should help you along.

This Query will give you the number of posts by year and month.

SELECT YEAR(post_date) as yer, MONTH(post_date) as mnth, COUNT(post_date) as num
FROM your_table
WHERE post_status = 'publish' 
GROUP BY YEAR(post_date), MONTH(post_date)
Steven