Title: Modified Categories.php, now displays wrong posts
Last modified: August 21, 2016

---

# Modified Categories.php, now displays wrong posts

 *  [George88](https://wordpress.org/support/users/george88/)
 * (@george88)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/modified-categoriesphp-now-displays-wrong-posts/)
 * Hey
 * I recently modified Categories.php for a friend’s website. The website is using
   the Twenty Twelve theme that I have customised to his specifications. I modified
   Categories.php in the following way:
 *     ```
       <?php
           $i = 0;
   
           query_posts($query_string.'&posts_per_page=10');
   
           /* Start the Loop */
           while ( have_posts() ) : 
   
           the_post();
           $post = get_post(get_the_ID());
       ?>
   
       <div class="custom-archive-item" style="<?php if($i == 0 || $i == 2 || $i == 4) echo "border-bottom: none;"; // awesome hacks ?>">
   
           <h1 class="custom-archive-h1">          <a href="removed"><?php echo $post->post_title; ?></h1></a>
           <div class="custom-archive-date">       <div class="custom-archive-label"><p>Posted on:          </p> </div><?php echo the_time("F dS Y"); ?></div>
           <div class="custom-archive-thumb">      <p><?php echo_first_image(get_the_ID()); echo get_the_excerpt(); ?></p></div>
           <p> </p>
           <?php $i++; endwhile; ?>
       ```
   
 * Every time a user clicks on an “archive” link, for example “June”, it won’t just
   show posts from that month, but posts from the beginning of time.
 * Could anybody help please? see the website at: [http://www.nbanewssource.com](http://www.nbanewssource.com)
   the archive links are in the sidebar.
 * Thank you.

Viewing 1 replies (of 1 total)

 *  Thread Starter [George88](https://wordpress.org/support/users/george88/)
 * (@george88)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/modified-categoriesphp-now-displays-wrong-posts/#post-3913613)
 * Is there any way to include in the get_post() function a parameter that selects
   only the posts with the date in the URL?
 * There must be a solution to this.
 * N.B. This is already on page 11 after 5 hours. How busy is this forum?!

Viewing 1 replies (of 1 total)

The topic ‘Modified Categories.php, now displays wrong posts’ is closed to new replies.

## Tags

 * [categories.php](https://wordpress.org/support/topic-tag/categories-php/)
 * [modified](https://wordpress.org/support/topic-tag/modified/)

 * 1 reply
 * 1 participant
 * Last reply from: [George88](https://wordpress.org/support/users/george88/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/modified-categoriesphp-now-displays-wrong-posts/#post-3913613)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
