• 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

    (@alkorr)

    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.