Show 3 latest headings (but not the most latest) (2 posts)

  1. triphys
    Posted 4 years ago #


    I'm using a script so I can write out the 3 latest headings from my blog under a post. But I don't want it to show the post you currently read, somehow I don't get that to work.

    This is my current code i'm going with:

    <div id="latest">
    									<?php $lastposts = get_posts('numberposts=3'); foreach($lastposts as $post) : setup_postdata($post);?>
    									<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    									<?php endforeach; ?>

    Thanks in advance

  2. http://codex.wordpress.org/Template_Tags/get_posts

    have you tried the 'offset' or 'exclude' parameter?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.