• I use the following code in a PHP include to display the last three posts on a non-wordpress page on my website:

    <?php
      define('WP_USE_THEMES', false);
      require('/home/georgeek/public_html/news/wp-blog-header.php');
      query_posts('showposts=1');
    ?>
    <?php
    global $post;
    $args = array( 'posts_per_page' => 3 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br />
    <?php endforeach; ?>

    It works well but I would now like to generalize it to display not the last 3 posts but 3 posts starting from the Nth most recent post.

    Any ideas please?

    Thank you.

  • The topic ‘Display links for N to N 3 posts’ is closed to new replies.