• Resolved Brett Bodine

    (@virtus-designs)


    I added the canceled and postponed and online extension to the events. I created a custom query to display a list of events on the home page with the title and date but is there a way to display the status of whether it is postponed, canceled or virtual?

    I am using these to display the start date, event link, event title and featured image. I currently have the following

    function homepage_events_shortcode( $atts, $content) {
    
    $content = '<div class="event-wrap"><div class="upcoming-events">';		
    		
    			global $event;
    			$all_events = tribe_get_events(array(
    				'eventDisplay'		=>	'all',
    				'posts_per_page'	=> 	10
    			));
    		
    			foreach($all_events as $event) { 
    				setup_postdata($event);
    
    $startdate = tribe_get_start_date($event->ID, false, 'F j, Y');
    $permalink = tribe_get_event_link($event->ID, false);
    //$image = the_post_thumbnail( 'medium' );
    $image = tribe_event_featured_image( $event->ID, 'medium' );
    			
    				$content .= '<div class="event-details">'.$image.'<a href="'.$permalink.'"><div class="event-list-info"><h3>' . $event->post_title . '</h3><span class="event-list-meta">'. $startdate .'</span></div><div class="event-list-button"><i class="fas fa-arrow-right"></i></div></a></div>';
    		}			
    	
    		$content .=	'</div></div>';
    wp_reset_query();	
    return $content;
    }

    I would like to display whether the event is canceled (with reason), postponed (with reason) or if it is a virtual event right after the start date. I couldn’t find any documentation on this extension.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi Brett!
    I would suggest checking the extension source code, specially this file:
    /tribe-ext-events-control/src/views/single/canceled-status.php

    To get a better idea about how we retrieve this value from the database.
    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Display Event Status in Custom Query’ is closed to new replies.