WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. triphys
    Member
    Posted 3 years ago #

    Hey

    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">
    									<ol>
    									<?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; ?>
    									</ol>
    								</div>

    Thanks in advance

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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

Tags

No tags yet.