Title: Post Count Today?
Last modified: August 19, 2016

---

# Post Count Today?

 *  [Ethics](https://wordpress.org/support/users/ethics/)
 * (@ethics)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/post-count-today/)
 * Hey guys,
 * I was wondering if anybody knew of a way to retrieve the days post count?
 * So only a total number of posts made that current day.
 * Any kind of plugin or example I could look at before trying to build this plugin?
 * Any help or suggestions are appreciated.
 * Thanks,
    Mario

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [jbjweb](https://wordpress.org/support/users/jbjweb/)
 * (@jbjweb)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/post-count-today/#post-1053819)
 * Your answer is there: [http://www.wprecipes.com/fromtheold-asked-how-to-display-how-many-post-have-been-published-today](http://www.wprecipes.com/fromtheold-asked-how-to-display-how-many-post-have-been-published-today)
 *  Thread Starter [Ethics](https://wordpress.org/support/users/ethics/)
 * (@ethics)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/post-count-today/#post-1053894)
 * Hey,
 * Thank you for the quick reply.
 * Unfortunately it seems that the code provides a count for the number of posts
   in the last 24 hours. This causes posts to be shown from the previous day until
   they have been around for 24 hours.
 * I’m trying to wrap my head around the formula and how we can make it only count
   the current days posts.
 * Here is the code if anybody wants a look at it…
 * [code]
    $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.' Wallpapers Added'; } else { echo "0 Wallpapers
   Added"; } [/code]
 * You have a beautiful website btw.
 * Oh and if you can update the code on the website to have a closing curly brace
   at the end that would save alot of headaches 🙂
 * Thanks,
    Mario

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Post Count Today?’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [Ethics](https://wordpress.org/support/users/ethics/)
 * Last activity: [17 years, 1 month ago](https://wordpress.org/support/topic/post-count-today/#post-1053894)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
