• Resolved steezY

    (@steezy)


    I’d like to have a list of previous post titles on my main page.

    For example, if I have a total of 15 posts and the 5 most recent posts are showing on my homepage, I’d like the titles of the 10 previous posts in a sidebar – sort of like an archive page.

    I apologize if that isn’t clear enough, if I need to clarify please let me know.

    How can I do this?

    EDIT: I just managed to get a list of post titles using wp_get_archive(), but how can i limit it so that it does not show any of the posts that are already on my front page?

Viewing 1 replies (of 1 total)
  • Thread Starter steezY

    (@steezy)

    I did a little more searching around and managed to answer my own question. Here’s the code you need, just in case anyone else is trying to do the same thing that I am:

    <ul>
    	<?php global $post;$myposts = get_posts('numberposts=10&offset=5');foreach($myposts as $post) :?>
    	<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    	<?php endforeach; ?>
    </ul>
Viewing 1 replies (of 1 total)

The topic ‘Listing post titles?’ is closed to new replies.