Title: Last Post
Last modified: August 18, 2016

---

# Last Post

 *  [evandroliveira](https://wordpress.org/support/users/evandroliveira/)
 * (@evandroliveira)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/last-post-1/)
 * Hello…
 * Hey I created a category called “O projeto” ok.
    Then in the index page I want
   to show the posts from this category… then I used the following code..
 * <div id = “bio_prev”>
    <?php $my_query = new WP_Query(‘category_name=O Projeto’);?
   > <?php if($my_query->have_posts()) : ?><?php while($my_query->have_posts()) :
   $my_query->the_post(); ?> <div class = “post1”> <h3 class = “projeto”>“> <?php
   the_title(); ?></h3> <div class = “entry1”> <?php the_excerpt(); ?> </div> </
   div> <?php endwhile; ?> <?php endif; ?> </div>
 * Everything Is ok.. But in this way the index page shows all post from this category
   but I just wnat to show ONE post from this category…. How Can I do that ?
 * Thank you for attention…

The topic ‘Last Post’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [evandroliveira](https://wordpress.org/support/users/evandroliveira/)
 * Last activity: [18 years, 10 months ago](https://wordpress.org/support/topic/last-post-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
