Support » Fixing WordPress » Last Post

  • 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(); ?>
    <?php endwhile; ?>
    <?php endif; ?>

    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.