0

I'm building a simple "company news/press release" site. We'd like to display the latest five post excerpts on the home page with the next three post titles (six through eight) and a single "Archives" button that takes the visitor to a new page that displays the sixth post and earlier.

I have the five post experts showing, but I can't get the other two things. Any help would be greatly appreciated!


UPDATE: Thanks, t-p, for the tip, but we need only the next three posts in the sidebar, not a duplicate of the first five and then the next three. In order words, the latest five will appear on the home page (already done) and posts 6 through 8 will appear in the sidebar only. Then, we want a link/button to take the visitor to a Archives page.

1
  • In addition to displaying the latest five post excerpts on the home page (that you are already doing), in the "Recent Posts" widget in the sidebar, select eight posts (titles) to be displayed in the sidebar.
    – Tara
    Dec 5, 2012 at 17:58

1 Answer 1

0
$args  = array( 'numberposts' => 3, 'offset' => 5 );
$posts = get_posts( $args );

foreach( $posts as $post ){

  setup_postdata( $post );

  [output the post here with the_title(), the_content(), etc]

}

If you search in the codex with 'query posts', you will find a lot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.