• Resolved billybandit

    (@billybandit)


    Hello I have two newbie questions.

    I would like to post the most recent post in a catergory as a feature but post the last 2 as a sub feature on my first page I know I need to change something in the following code but what.

    <?php $recent = new WP_Query(“cat=3&showposts=2”); while($recent->have_posts()) : $recent->the_post();?>
    <b>” rel=”bookmark”><?php the_title(); ?></b><?php the_content_limit(130, “”); ?>

    <div class=”hppostmeta”><p><?php the_time(‘F j, Y’); ?> | ” rel=”bookmark”>Read the story »</p>

    </div>

    <?php endwhile; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Kafkaesqui

    (@kafkaesqui)

    I would like to post the most recent post in a catergory as a feature but post the last 2 as a sub feature

    The last 2, or the 2 after the most recent? If this is correct, look at using the ‘offset’ parameter, which allows you to… offset the posts it collects by a specified amount:

    $recent = new WP_Query("cat=3&showposts=2&offset=1");

    If this is not what you’re looking for, please be clearer about what you need.

    Thread Starter billybandit

    (@billybandit)

    Guy you are Awesome that you I knew it was easy

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with recent post and limit code’ is closed to new replies.