Title: Listing latest posts
Last modified: August 19, 2016

---

# Listing latest posts

 *  [aarreoskari](https://wordpress.org/support/users/aarreoskari/)
 * (@aarreoskari)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/listing-latest-posts/)
 * How could I list links to latest posts from blog inside a sidebar?
 * I’ve done this earlier by running following iteration inside sidebar.php. First
   query all posts and then shout out only five first posts. This works fine until
   you move your sidebar from right to left. Running query_posts() before the actual
   Loop screws everything up.
 * `query_posts('orderby=date'); $iteration = 1;`
    `if ( have_posts() ) : while (
   have_posts() ) : the_post();` `if ( $iteration > 5 ) { break; } else { $iteration
   ++; }` `the_permalink(), the_title(); ...` `endwhile; else:` `_e('Sorry, no posts
   matched your criteria.');` `endif;`

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

 *  [wp_guy](https://wordpress.org/support/users/wp_guy/)
 * (@wp_guy)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/listing-latest-posts/#post-769266)
 * I think you can get the regular loop to work fine if you add this line in between
   the two loops:
 * `<?php query_posts($query_string); ?>`
 * That sort of resets the whole thing 😉
 *  [bradstinyworld](https://wordpress.org/support/users/bradstinyworld/)
 * (@bradstinyworld)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/listing-latest-posts/#post-769318)
 * If what you want is just a list of the latest post the easiest answer is a widget.
   I don’t care for the standard widget personally nor the standard rss widget, 
   but KB Advanced RSS Widget IS GREAT! I use it to show my latest stumbles, diggs
   and entrecard drops find at [http://www.bradsotherblog.com](http://www.bradsotherblog.com)
 * There is a plugin called recent posts that works pretty well too if you look 
   at the header at [http://www.bradstinyworld.com](http://www.bradstinyworld.com)
   it is what I use to display the posts and could easily be coded for a sidebar
   as well.

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

The topic ‘Listing latest posts’ is closed to new replies.

 * 2 replies
 * 3 participants
 * Last reply from: [bradstinyworld](https://wordpress.org/support/users/bradstinyworld/)
 * Last activity: [17 years, 12 months ago](https://wordpress.org/support/topic/listing-latest-posts/#post-769318)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
