views:

18

answers:

2

Hi! In my sidebar, I show a list of the latest wordpress posts like this: wp_get_archives('type=postbypost&limit=10');

This will also show links to the posts that are currently visible on the front page of my blog. It makes no sense to include those posts in the list if they are visible on the home page.

In the codex, I could not find an option to exclude the posts that are on the front page. How do I do that?

A: 

Use the 'offset' parameter, like this:

wp_get_archives('type=postbypost&limit=10&offset=0');

Of course you have to replace 0 with the desired number of posts to skip.

Evert
I tried this, but the offset parameter is not working. It is also not a documented parameter: http://codex.wordpress.org/Function_Reference/wp_get_archives
reggie
A: 

I don't think wp_get_archives has the offset functionality.
http://codex.wordpress.org/Function_Reference/wp_get_archives

You will have to use get_posts instead. You can use the aforementioned offset paramter or maybe set it up so that it shows 10 random posts!

Sanchit