Title: posts by a specific date
Last modified: August 30, 2016

---

# posts by a specific date

 *  Resolved [Wanderley Souza](https://wordpress.org/support/users/wanderley-souza/)
 * (@wanderley-souza)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/posts-by-a-specific-date/)
 * I can list all the posts by a specific date?
 * Below an idea to understand.
 * <!– Loop –>
    <?php if(have_posts()) : while(have_posts()) : the_post(); **get_the_time(‘
   d-m-Y’) == ’29-10-2015′**; ?>
 * Where **get_the_time(‘d-m-Y’)** would receive the date of the post (post_date)
   and **’29-10-2015′** would be my condition to list only posts this day.
 * Obs .: Align bold code above does not work very least it is logical (rsr) … it’s
   just to represent what I need.

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

 *  [Ravikumar Patel](https://wordpress.org/support/users/ravipatel/)
 * (@ravipatel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/posts-by-a-specific-date/#post-6711791)
 * Hi Wanderley Souza,
    Using this code and define your date for post listing.
 *     ```
       <?php
   
       // Setup arguments.
       $args = array(
           // Day (1 - 31).
           'day' => date( 'j' ),
           // Month (1 - 12).
           'monthnum' => date( 'n' ),
           // Year (minus 1).
           'year' => date( 'Y' ) - 1,
           // Show no of post -1 to all
           'posts_per_page' => 10
       );
   
       // Instantiate new query instance.
       $my_query = new WP_Query( $args );
   
       ?>
       ```
   
 *  Thread Starter [Wanderley Souza](https://wordpress.org/support/users/wanderley-souza/)
 * (@wanderley-souza)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/posts-by-a-specific-date/#post-6711809)
 * Sorry, I’m new to wordpress and can not apply this code. Can you give me more
   details on how to apply it?
 *  [Ravikumar Patel](https://wordpress.org/support/users/ravipatel/)
 * (@ravipatel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/posts-by-a-specific-date/#post-6711815)
 *     ```
       <?php
           $args = array(
           'day' => '29',
           'monthnum' => '10',
           'year' => '2015',
           'posts_per_page' => -1
       );
           $my_query = new WP_Query( $args );
           if($my_query->have_posts()):
   
           while ( $my_query->have_posts() ) :
               $my_query->the_post();
       ?>
           <h2><a href="<?php echo get_permalink(); ?>"><?php echo get_the_title(); ?></a></h2>
           <?php echo get_the_excerpt(); ?>
   
       <?php
           endwhile;
           endif;
           wp_reset_postdata();
       ?>
       ```
   
 *  Thread Starter [Wanderley Souza](https://wordpress.org/support/users/wanderley-souza/)
 * (@wanderley-souza)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/posts-by-a-specific-date/#post-6711829)
 * Perfect. It was exactly what she needed. Many thanks ravipatel for help.

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

The topic ‘posts by a specific date’ is closed to new replies.

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [list](https://wordpress.org/support/topic-tag/list/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Wanderley Souza](https://wordpress.org/support/users/wanderley-souza/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/posts-by-a-specific-date/#post-6711829)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
