Title: Display posts by week
Last modified: August 21, 2016

---

# Display posts by week

 *  [coke](https://wordpress.org/support/users/coke/)
 * (@coke)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/display-posts-by-week/)
 * Hi there, I am wondering if there is any way to show and navigate posts by week.
 * I want the home page to show the posts from the current week, and then each page
   before that the posts from the weeks before, if that makes sense. the main problem
   is that I won’t have a fixed amount of posts per week.
 * is this possible?

Viewing 1 replies (of 1 total)

 *  Thread Starter [coke](https://wordpress.org/support/users/coke/)
 * (@coke)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/display-posts-by-week/#post-5042133)
 * I found this code, which seems to be working. The only problem is the **pagination**
   doesn’t seem to be working! Any ideas?
 *     ```
       <?php
       $week = date('W');
       $year = date('Y');
       $args=array(
         'w'=> $week,
         'year'=> $year,
         'post_type' => 'post',
         'post_status' => 'publish',
         'posts_per_page' => -1,
         'caller_get_posts'=> 1
       );
       $my_query = null;
       $my_query = new WP_Query($args);
       if( $my_query->have_posts() ) {
         echo 'List of Posts for year '.$year . ' week '.$week;
         while ($my_query->have_posts()) : $my_query->the_post(); ?>
           <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
           <?php
         endwhile;
       }
       wp_reset_query();  // Restore global post data stomped by the_post().
       ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Display posts by week’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [navigation](https://wordpress.org/support/topic-tag/navigation/)

 * 1 reply
 * 1 participant
 * Last reply from: [coke](https://wordpress.org/support/users/coke/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/display-posts-by-week/#post-5042133)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
