sabinevi

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • sabinevi
    Participant

    Thanks for the correction of the ordering snippet!

    This is the complete code of the testpage template:

    
    <?php
    /*
    Template Name: testevents
    */
    
    get_header();
    
    $now_amsterdam = new DateTime( 'now', new DateTimeZone( 'Europe/Amsterdam' ) );
    $aEvents = tribe_get_events( array( 'start_date' => $now_amsterdam, 'posts_per_page' => -1 ) );
    
    echo '<table border="1"><tr><td>title</td><td>start</td><td>end</td></tr>';
    
    foreach( $aEvents as $o ) {
    	echo '<tr><td><b>'.$o->post_title.' </b></td>';
    	echo '<td>'.$o->EventStartDate.' </td>';
    	echo '<td>: '.$o->EventEndDate.'</td></tr>';
    	
    }
    echo '</table>';
    
    get_footer();
    
    sabinevi
    Participant

    I have to add that I have an alternative ordering set in the functions.php:

    function tribe_post_alternatieve_sortering( $query ) {
    	
        	$query->set( 'orderby', 'start_date' );
    	$query->set( 'order', 'DESC' );
    
    	return $query;
    }
    
    add_action( 'pre_get_posts', 'tribe_post_alternatieve_sortering', 51 );
    sabinevi
    Participant

    Hi Cliff,

    Thanks for your reply! I don’t think the timezone is the issue here. This website deals with art-exhibitions that most of the time end several months after they start so I think it’s a date-problem, not a time-problem.
    If you have a look at my testpage (where I use this tribe_get_events) you can see that the events there have start dates between January 2018 and July 2018. I would expect to see only the top six events since those are the only ones that start after today (June 3rd). What am I missing here?

    in reply to: Overriding the generate_markers method #1433521
    sabinevi
    Participant

    YES! Thank you very much Barry, problem solved

    in reply to: Upcoming and past events on single venue page #940842
    sabinevi
    Participant

    Hi Brook,

    Thanks for your solution. I think I must have omitted a semi-colon or comma in my initial code because I managed to get it to work.
    For those of you who come here looking for answers, this is the code I used in the overridden single-venu.php:

    	do_action('tribe_events_single_venue_before_upcoming_events') 
    	// First show upcoming events
    	echo tribe_include_view_list( array(
    		'venue'          => $venue_id,
    		'eventDisplay'   => 'upcoming',
    		'posts_per_page' => apply_filters( 'tribe_events_single_venue_posts_per_page', 100 )
    	) );
    	// and then those from the past
    	wp_reset_postdata(); 
    	echo tribe_include_view_list( array(
    		'venue'          => $venue_id,
    		'eventDisplay'   => 'past',
    		'posts_per_page' => apply_filters( 'tribe_events_single_venue_posts_per_page', 100 )
    	) );
    	do_action('tribe_events_single_venue_after_upcoming_events');
    in reply to: How to show selected events on homepage #183125
    sabinevi
    Participant

    Thanks for your fast reply Casey. I had a look at the Event Rocket plugin and it can actually do what I thought my client wanted. But then it turned out that he wanted to have the first upcoming event of each of the four categories on the homepage and I can probably achieve that with the help of this page in the documentation: https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events.
    Thanks again!

    in reply to: date needs to be in French format #171843
    sabinevi
    Participant

    Thank you Casey, I was having the same issue and it’s resolved now!

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