WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Try to show the last post from X category (3 posts)

  1. Neverio
    Member
    Posted 4 years ago #

    Hello

    I try to show the last post from X category.
    But dont get i to work.
    When i try this code i have, i got the last post on all the other plase to.

    <?php
    query_posts('posts_per_page=1', 'cat=3');
    while (have_posts()) : the_post();
    the_content();
    endwhile;
    ?>

    So can some one help me? :)

  2. MichaelH
    Member
    Posted 4 years ago #

    Not sure where you are using that, but at the least it would need to look like this:

    query_posts('posts_per_page=1&cat=3');
  3. Neverio
    Member
    Posted 4 years ago #

    that worked :)

    Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.