Support » Plugin: The Events Calendar » [Unknown column ‘EventStartDate’ in ‘order clause’]

  • i am getting this issue in elemento while i run custom query for tribe_events post type.

    how can i resolve it ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I also ran into this issue. My query is a simple:

    $events = new WP_Query( array(
    	'paged'				=> $current_page,
    	'posts_per_page'	=> $per_page,
    	'post_type'			=> 'tribe_events',
    	'post_status'		=> array( 'publish' ),
    	'meta_query'		=> array( array(
    		'key'		=> '_EventEndDateUTC',
    		'value'		=> date( 'Y-m-d', strtotime( 'today' ) ),
    		'compare'	=> '<',
    		'type'		=> 'DATE',
    	) ),
    ) );

    I can suppress this error by stating 'suppress_filters' => true, but that doesn’t seem right.

    I’m getting a similar error when using the Beaver Builder plugin ( Premium edition) + Beaver Themer, but I found out that the error is actually coming from the TEC plugin’s Tribe__Events__Query::posts_orderby() method. In our case, the fix was this filter code:

    
    add_filter( 'tribe_query_can_inject_date_field', function( $can_inject, $query ) {
    
        if ( 'tribe_events' == $query->query[ 'post_type'] ) {
            return false;
        }
    
        return $can_inject;
    }, 10, 2 );
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.