WordPress.org

Ready to get started?Download WordPress

Forums

get_archives offset parameter (7 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    I would like to set up my site to include a "Recent Posts" listing. If, for example, the blog displayed the 10 newest posts ("entries 1 - 10") then I would like "Recent Posts" to list the tiles of "entries 11 - 20".
    To do this would only require adding an additional parameter to get_archives which specifies the "entry #" at which to start.
    I could write it myself (and just might), but this introduces maintenance hassles and I think it might be of value to others.

  2. antifuse
    Member
    Posted 10 years ago #

    You probably don't want to provide entry #, as that would require knowing what the most recent post # is. A simple offset would be nice to start with.
    But while we're talking about the get_archives function, why is limit a string parameter? It should really be an int.

  3. elisepps
    Member
    Posted 8 years ago #

    what "unregistered" has asked is just what I am trying to do, unfortunately, writing it myself is not an option, as I have no clue :-)

    I am using Hemingway, which shows the most recent 2 posts in the main body. So in the sidebar, where I am listing "recent entries", I want to EXCLUDE those last 2 entries. how can I do this?

    thanks, Elisabeth

  4. moshu
    Member
    Posted 8 years ago #

    Please, don't double post after 19 minutes!!!
    (usually it gets deleted)

  5. elisepps
    Member
    Posted 8 years ago #

    I didn't mean to- promise! I got a message saying "Something odd happened."- so I thought that meant my reply didn't work- that's why I tried to repost. *sorry*

  6. moshu
    Member
    Posted 8 years ago #

    If your theme is using the "get_archives" template tag mentioned in the title of this topic - that one does NOT have an offset parameter:
    http://codex.wordpress.org/Template_Tags/get_archives
    Your best bet would be to ask the author of the theme about your request.

  7. elisepps
    Member
    Posted 8 years ago #

    I don't know how to know if my theme uses that template tag or not, nor am I familiar with the parameters... I have asked at the Hemingway site. thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.