Support » Themes and Templates » How to show recent posts EXCEPT the latest?

  • Resolved jamesinternet

    (@jamesinternet)


    Hi,

    Right now I’m working on a custom theme for a personal site: http://shakeydesigns.com/wp/

    As you can see on the main page I have the latest article displayed in full and underneath there are links to the three most recent posts.

    This is generally what I’m going for, but it’s rather redundant to have a link to the post the reader just read.

    Right now it goes:

    FULL TEXT OF MOST RECENT ARTICLE
    Link to most recent article
    Link to 2nd most recent article
    Link to 3rd most recent article

    How do I change the recent posts to show the 3 most recent posts, EXCEPT for the very latest one? In other words:

    FULL TEXT OF MOST RECENT ARTICLE
    Link to 2nd most recent article
    Link to 3rd most recent article
    Link to 4th most recent article

    This is the code for the links I’m using right now:

    <?php
        $args=array(
          'post_type' => 'post',
          'post_status' => 'publish',
          'posts_per_page' => 3,
          'caller_get_posts'=> 1
          );
        $my_query = null;
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
          while ($my_query->have_posts()) : $my_query->the_post(); ?>
          <div id=title><h1 style="font-size: 18pt;"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1></div><div id=content><div class=catslug style="padding-left: 50px; padding-right: 50px;"><?php if (function_exists('the_subheading')) { the_subheading(); } ?><br><span class=date><?php the_time('l, F j, Y') ?></span></div></div>
           <?php
          endwhile;
        }
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to show recent posts EXCEPT the latest?’ is closed to new replies.