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…
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.
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?
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.