Ash

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Create a 'All Events Next Month" Page #1020172
    Ash
    Participant

    Brook,

    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

    in reply to: Create a 'All Events Next Month" Page #1019699
    Ash
    Participant

    I’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?

    in reply to: Create a 'All Events Next Month" Page #1019672
    Ash
    Participant

    Brook,

    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?

    in reply to: Create a 'All Events Next Month" Page #1019007
    Ash
    Participant

    Hi,

    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?

    in reply to: Create a 'All Events Next Month" Page #1018791
    Ash
    Participant

    Thanks,

    I’m now creating the loop using get_events. How do I make it query next week, month, etc?

    in reply to: Create a 'All Events Next Month" Page #1018677
    Ash
    Participant

    Thanks for the quick reply. I tried using the short code, but couldn’t see how to limit to ‘next month’. Did I miss that?

Viewing 6 posts - 1 through 6 (of 6 total)