Title: Show last post doesn&#039;t work!?
Last modified: August 19, 2016

---

# Show last post doesn't work!?

 *  [Alkorr](https://wordpress.org/support/users/alkorr/)
 * (@alkorr)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/show-last-post-doesnt-work/)
 * Hi. I thought what I wanted to do was simple but obviously, it’s not… I want 
   to show the latest published post on my blog and I used this code:
 *     ```
       <?php query_posts('posts_per_page=1'); ?>
       <?php if (have_posts()) : while(have_posts()) : the_post(); ?>
       <a>" rel="bookmark" title="Read: <?php the_title(); ?>"><?php the_title(); ?></a>
       <?php the_excerpt(); ?>
       <?php endwhile; ?>
       <?php endif; ?>
       ```
   
 * If I don’t put a ‘tag=’ right after ‘posts_per_page=’ I have more than one post
   showing. I need to customize the latest post so I want to make a query for it.
   Is this a bug or else? There is no other query on my page. I don’t understand
   why it doesn’t work 🙁
 * Thanks for your help!

Viewing 1 replies (of 1 total)

 *  Thread Starter [Alkorr](https://wordpress.org/support/users/alkorr/)
 * (@alkorr)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/show-last-post-doesnt-work/#post-2014013)
 * Me again. I tried to use ‘showposts’ instead of ‘posts_per_page’ but it gives
   the same result… Any suggestion? Thanks!

Viewing 1 replies (of 1 total)

The topic ‘Show last post doesn't work!?’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [Alkorr](https://wordpress.org/support/users/alkorr/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/show-last-post-doesnt-work/#post-2014013)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
