Title: Updated Posts At Top
Last modified: August 30, 2016

---

# Updated Posts At Top

 *  [Tanuj Singh](https://wordpress.org/support/users/tanuj-singh/)
 * (@tanuj-singh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/)
 * Suppose I update a post that was published 2-3 days ago, how am I supposed to
   put it on top of other posts like what happens with new posts?

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

 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889113)
 * Hi,
 * This tutorial might help;
 * [http://www.wpbeginner.com/wp-tutorials/how-to-display-a-list-of-last-updated-posts-in-wordpress/](http://www.wpbeginner.com/wp-tutorials/how-to-display-a-list-of-last-updated-posts-in-wordpress/)
 * Thank you.
 *  Thread Starter [Tanuj Singh](https://wordpress.org/support/users/tanuj-singh/)
 * (@tanuj-singh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889114)
 * Nope, that’s about making a list of last updated posts, I am looking to make 
   the last updated posts come at top just like what happens when you publish a 
   new post.
 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889117)
 * Hi,
 * Yes correct but in your case or whatever your loop is, you would sort your post
   listing by the modified filter like so;
 * [code]
    'orderby' => 'modified', [/code]
 * Thank you
 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889118)
 * I meant;
 * `'orderby' => 'modified',`
 * Sorry
 *  Thread Starter [Tanuj Singh](https://wordpress.org/support/users/tanuj-singh/)
 * (@tanuj-singh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889119)
 * And how to do this?
 *  Thread Starter [Tanuj Singh](https://wordpress.org/support/users/tanuj-singh/)
 * (@tanuj-singh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889120)
 * Sorry, kinda new to WordPress hehe.
 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889123)
 * First, lets find out which page or area of your site your like to do this on?
   🙂
 *  Thread Starter [Tanuj Singh](https://wordpress.org/support/users/tanuj-singh/)
 * (@tanuj-singh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889128)
 * Here, on the front page: [http://bit.ly/1OvZhm9](http://bit.ly/1OvZhm9)
 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889166)
 * Hi,
 * This will be slightly hard to do; first you need to locate the file in your template
   that controls the homepage loop. A look looks similar to this;
 *     ```
       <?php
   
          $args = array('cat' => 4);
          $category_posts = new WP_Query($args);
   
          if($category_posts->have_posts()) :
          while($category_posts->have_posts()) :
          $category_posts->the_post();
       ?>
       ```
   
 * [https://codex.wordpress.org/The_Loop_in_Action](https://codex.wordpress.org/The_Loop_in_Action)
   <– you can read more on that there.
 * Now after you locate the loop, you have to modify that loop into something like
   this;
 * <?php
 *  $args = array(‘cat’ => 4, ‘orderby’ => ‘modified’);
    $category_posts = new WP_Query(
   $args);
 *  if($category_posts->have_posts()) :
    while($category_posts->have_posts()) : 
   $category_posts->the_post(); ?>
 * Let me know if that works. It’s hard because each theme and its loop is coded
   differently and any wrong doing can really make a mess of the way your post within
   that area are displayed or break the template. That said, I would do backups 
   of any files you’re about to change.
 * Thank you,

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

The topic ‘Updated Posts At Top’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 2 participants
 * Last reply from: [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/updated-posts-at-top/#post-6889166)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
