Forum Replies Created
-
AuthorPosts
-
Ash
ParticipantBrook,
That makes complete sense – thank you. I’m surprised that more folks haven’t requested this type of feature – perhaps your plugin attracts more seasoned developers than me!
I think I have all I need, so I’ll mark this as resolved. Many thanks,
Ash
Ash
ParticipantI’m having issues with the other strtotime functions. Plus one month, two months, etc seems to work OK, but using plus week, doesn’t seem to be calculating quite right, returning events that are not in scope. Example is this query:
// Retrieve all events in coming two weeks $now = strtotime('now'); $query_date = strtotime('+2 week'); $events = tribe_get_events( array( 'eventDisplay' => 'custom', 'start_date' => date($now), 'end_date' => date('Y-m-t', $query_date) ) );This should return events in the range today (29 Oct) to 12 Nov, of which there are none. Yet I have an event with a date of 19 Nov that is being returned.
Is there a further rule I need to add in here?
Ash
ParticipantBrook,
Thanks – I think I’m just about there and can adapt this piece of code to achieve what I need.
It does seem odd that this sort of function isn’t included as core, though. Most other event plugins I’ve used do, often called with simple shortcodes. Is there a reason for the omission?
Ash
ParticipantHi,
I’m struggling with creating this rule to apply dynamically.
This just break the page:
<?php $query_date = 'now'; // Ensure the global $post variable is in scope global $post; // Retrieve all events in coming month $events = tribe_get_events( array( 'eventDisplay' => 'custom', 'start_date' => 'new DateTime()', 'end_date' => 'echo date('Y-m-t', strtotime($query_date));' ) );I assume my syntax is wrong?
Ash
ParticipantThanks,
I’m now creating the loop using get_events. How do I make it query next week, month, etc?
Ash
ParticipantThanks for the quick reply. I tried using the short code, but couldn’t see how to limit to ‘next month’. Did I miss that?
-
AuthorPosts
