• Hi there, I finally find a way to solve my old problem of retrieve info from event but once I get the post of my query I get also old events that I don’t want anymore in my list.

    Is there a way to exclude them from query… like I see in the widget.

    I add my query code, hope it could help.

    <div id="events" class="events_list">
    					<?php
    
    					// The New Events Query
    					$args = array(
    									'posts_per_page'  => 4,
    									'paged' 		  => get_query_var('paged'),
    									'post_type'       => 'ai1ec_event',
    									'orderby'         => 'date',
    									'order'           => 'DESC',
    									'post_status'     => 'publish' );
    
    					$events_added = new WP_Query( $args );
    
    					// The Loop
    					while ( $events_added->have_posts() ) : $events_added->the_post();
    
    					$event = Ai1ec_Events_Helper::get_event($post->ID);
    
    					?>
    						<div class="single_post">
    							<div class="text_container">
    								<a class="single-title" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
    									<h2><?php the_title(); ?></h2>
    								</a>
    								<span>
    									<ul>
    										<li class="home_when"><?php echo $event->long_start_date;?> -</li>
    										<li><?php echo $event->short_end_date;?></li>
    										<li class="home_where"><?php echo $event->venue; ?></li>
    										<li><?php echo $event->city; ?>, <?php echo $event->country; ?></li>
    									</ul>
    								</span>
    							</div>
    						</div>
    					<?php
    
    					endwhile;
    					// Paging
    					// if(function_exists('wp_pagenavi')) { wp_pagenavi( array( 'query' => $events_added ) ); }
    
    					// Reset Post Data
    					wp_reset_postdata();
    					?>
    				</div><!-- #events_added -->

    Thanks in advance
    Regards

    Carloalberto

    https://www.ads-software.com/extend/plugins/all-in-one-event-calendar/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: All-in-One Event Calendar] Exclude old events from custom query’ is closed to new replies.