how display last five posts not incl most recent? (3 posts)

  1. puk
    Posted 10 years ago #

    I've read the loop articles and stuff, i've tried to use the code but am struggling with errors as not a huge php buff. I'm understand that i want to use a query like

    $posts = get_posts('numberposts=3&offset=1&category=1');

    But am unsure of how to use it within my code, i dont want to display any links or anything back to wordpress so my code atm looks like:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_date('','<b>','</b>'); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <b class="storytitle"><?php the_title(); ?></b>
    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>

    I've fiddled about with bits and pieces but as i say am just getting errors, can someone point me in the right direction please!

  2. puk
    Posted 10 years ago #


    How do i make a query for the last three posts, not including the most previous? there must be somewhere on here that knows!



  3. vkaryl
    Posted 10 years ago #

    There were some fairly detailed threads about this a few months back; you'd have to use the search box option top right of the page....

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.