Get the last updated event

Home Forums Calendar Products Events Calendar PRO Get the last updated event

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #26229
    webotools
    Participant

    Hi! I was wondering is there is a way to get the last updated event in a query (no matter when it is to start)

    I am using the code <?php $recent = new WP_Query("showposts=1&post_type=tribe_events"); and the output is the current's day event. The problem is that when there is an event lasting e.g. 1/10 – 30/10 it shows the same event every day… I tried using order=ASC and DESC but no change…

    Thanks in advance!

    #26235
    Barry
    Member

    I’m not sure that WP_Query supports that directly, though I guess you could modify the query by creating the appropriate filters – you would probably need to reference the post_modified column.

    #26322
    webotools
    Participant

    Barry hi,
    In fact, I would like to have something very simple. I want to get the last submitted post (the default wordpress loop gets you that one but with the events this does not happen).

    e.g. if I publish an event right now (no matter when its start date is) I want to display it on my home page. Is that possible in an easy way or I need to make a complicated query?

    Thanks.

    #26330
    Barry
    Member

    Oh I see, so the most recently published rather than the most recently modified? Yeah I would have thought you could do that with WP_Query without too much difficulty (though I could be wrong) – hang tight and I’ll see if I can find some code for this.

    #26331
    Barry
    Member

    Something like this maybe? http://pastebin.com/88XHLXBP

    #26400
    webotools
    Participant

    Barry, thanks, our developer figured it out and it was like the link you sent us!

    #26404
    Barry
    Member

    Great!

    #977957
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Get the last updated event’ is closed to new replies.