Title: DIsplay new posts count
Last modified: August 20, 2016

---

# DIsplay new posts count

 *  [Yegres](https://wordpress.org/support/users/yegres/)
 * (@yegres)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/display-new-posts-count/)
 * How do display total posts count and new posts amount added today? For example:
   
   Total posts:2000 (+23)?

Viewing 1 replies (of 1 total)

 *  Thread Starter [Yegres](https://wordpress.org/support/users/yegres/)
 * (@yegres)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/display-new-posts-count/#post-2266087)
 * **Solved.**
    Add new widget:
 *     ```
       <h4>Total posts: <strong><?php echo wp_count_posts()->publish; ?></strong> <span style="color: #99cc00;"><span style="color: #000000;">(</span>+<?php   function filter_blog($where = '') {
       //posts in the last 30 days
       $where .= " AND post_date > '" . date('Y-m-d', strtotime('-1 days')) . "'";
       return $where;   }
       add_filter('posts_where', 'filter_blog');
       $args=array(
       'post_type' => 'post',
       'post_status' => 'publish',
       'showposts' => -1,
       'caller_get_posts'=> 1
       );
       $my_blog=new WP_Query($args);
       remove_filter('posts_where', 'filter_blog');
       if( $my_blog->have_posts() ) {
       echo count($my_blog->posts) . ' new';
       while ($my_blog->have_posts()) : $my_blog->the_post(); ?>
       <?php     endwhile;   }
       //if ($my_blog) wp_reset_query(); //just in case ?><span style="color: #000000;">)</span></span></h4>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘DIsplay new posts count’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [Yegres](https://wordpress.org/support/users/yegres/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/display-new-posts-count/#post-2266087)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
