WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Post List
Select posts by date range? (13 posts)

  1. sensato
    Member
    Posted 10 months ago #

    I'd like to select posts based on their publish date, eg. only posts published since 2013-09-20. Is this possible?

    I see there was a similar query 8 months ago 'Picking a date and displaying all post for a specific month' and it has been marked [resolved], but I can find no date-related options in the Settings.

    Nice work, BTW!

    http://wordpress.org/plugins/advanced-post-list/

  2. EkoJr
    Member
    Plugin Author

    Posted 10 months ago #

    I think it was a work around in PHP that was used to format the dates, not query them. Although, I'll possibly be adding a setting to select the date range in 0.4.. I originally was waiting till the jQuery UI calendar interface was more refined and functional.

  3. EkoJr
    Member
    Plugin Author

    Posted 10 months ago #

    Oh, now i see. I don't know what went on with that post. I didn't mark it as resolved.

  4. garethsb
    Member
    Posted 9 months ago #

    This plugin looks great, but I think this feature is what I need too. I've been searching everywhere for a shortcode to insert into a post a list of links to all posts between specified start and end date/times.

    Does this make sense?

    If I could combine this with being able to format the list, choosing to include/exclude categories, etc. that'd be even better.

    If the date range supported relative times, to viewing-date (today) and current-post-date, that'd be an extra bonus.

    Thanks!

  5. EkoJr
    Member
    Plugin Author

    Posted 9 months ago #

    I think this conversation might of carried over into a different thread, and some info was posted there.

    I have looked into how I would implement this...and it's probably a good thing I waited to add this feature. WordPress offers a date filter in WP_Query, but only for 1 date. So, you would have to set it as before or after so and so date...and I want to add a date range instead. So, I have to look into meta query strings first before I can start on designing it.

    Meta strings might enable more filter for other time-stamps too, but I have to look into it sometime after I finish the current projects at hand.

  6. garethsb
    Member
    Posted 9 months ago #

    Thanks for the quick reply!

    Does the new WP_Query date_query in 3.7 help? The before/after example in the doc sounds like what I want... If I knew how to get from there to a shortcode I could use in my posts, which I don't. :-)

  7. EkoJr
    Member
    Plugin Author

    Posted 9 months ago #

    Currently, I'm going by the research I did and what the WP codex says. I haven't read up on 3.7, but I did just recently add it as a testing platform. If they added something new, then I haven't heard of it yet...

    APL 0.3 had a major change in its design. It went from using the get_posts function to the WP_Query class. So, there's still a lot to be done from the current version :/

  8. garethsb
    Member
    Posted 9 months ago #

  9. EkoJr
    Member
    Plugin Author

    Posted 9 months ago #

    That only has 1 date_query argument. APL needs 2 to build on.

    WordPress - get posts by date range. It would work something like that. We would have to modify WP_Query's SQL string basically.

  10. garethsb
    Member
    Posted 9 months ago #

    Sorry, I guess I'm missing something, because the example Return posts from January 1st to February 28th seems to have a single date_query fetching a range.
    Thanks for the filter_where link.

  11. EkoJr
    Member
    Plugin Author

    Posted 9 months ago #

    Hmmm, perhaps I take that back. I don't remember seeing that. I'll definitely be testing that out.

    Unfortunately, nothing more is going to be added to 0.3. APL already had a couple database updates in 0.3, but 0.4, 0.5, etc. is a different story. I'm working on getting 0.3 stable, but work on 0.4 has already started.

    However, if you, or someone else you know, want to add this. You can easily fork on GitHub, and in turn you can request your version to be added to APL. It's just, every subversion is saved for modifications/updates to the plugin's saved data (database), and most of it is already pre-planned for what's in mind in the future, but any contributors would help.

  12. martnorth
    Member
    Posted 9 months ago #

    I am assuming that when you are referring to date range you are talking about the previous #days? so the last 7 days for instance.

    Maybe I'm not picking up what you putting down?

    If not is there a way of displaying only the last 7 days?

    I looked into the PHP of it all to see if I could manipulate the shortcodes for the dates and realised that wouldn't work anyway. But would this date('Y-m-d', strtotime('-7 days')) kind of thing help?

    I use this plug-in on various sites and now only use this plugin to display any posts. It's great!

  13. sensato
    Member
    Posted 9 months ago #

    martnorth: In my own case, yes, a selectable previous number of days is what I really could use, eg. 'all posts 30 days old or less'

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.