Forums

using add_filter returns too many posts (1 post)

  1. rramsey
    Member
    Posted 9 months ago #

    Hi,

    This is a newbie question, but I just can't seem to find the answer in the codex docs.

    I want to retrieve all posts published in the last 30 days and display all of them. This is a very new blog, so there aren't posts more than 30 days old, but there are lots of revisions.

    If I just do query_posts('posts_per_page=-1') then I get all the current revision of all posts. No previous versions.

    If I add add_filter('posts_where', 'filter_where') before the query_posts call, then it gives me every version of every post. Literally 20 times the number of posts. The filter_where() function correctly returns AND post_date >= DATE('2011-07-09').

    What else do I need to add to the filter to only get the most current version of a post? Also, if a post was created 60 days ago, then revised yesterday, it should show up in the list.

    I know this is newbie, but I just can't seem to find what I need.

    Thanks,

    Bob

Reply

You must log in to post.

About this Topic