• Resolved rebecca-paisley

    (@rebecca-paisley)


    I inherited this site for a client. The events are not appearing in chronological order, but isn’t that the default setting?

    Here is the archives-events.php that’s located within the child theme directory:

    <?php get_header(); ?>
    
    		<section class="content">
    
    			<div class="pagetitle row">
    				<div class="col-md-12">
    
    					<div class="wrapper">
    						<h1><?php
    							if( eo_is_event_archive('day') )
    								//Viewing date archive
    								echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('jS F Y');
    							elseif( eo_is_event_archive('month') )
    								//Viewing month archive
    								echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('F Y');
    							elseif( eo_is_event_archive('year') )
    								//Viewing year archive
    								echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('Y');
    							else
    								_e('Events','eventorganiser');
    					?></h1>
    						<?php if(function_exists('yoast_breadcrumb')){ yoast_breadcrumb(); } ?>
    					</div>
    
    				</div>
    			</div>
    
    			<div class="row">			
    
    			    <main class="archive-page <?php 
    
    			    	if( $iw_opt['archive_sidebar'] == '2' ){
    			    		// right
    			    		echo('col-md-9 col-md-push-3');
    			    	}elseif( $iw_opt['archive_sidebar'] == '1' ){
    			    		//fullwidth
    				    	echo('col-md-12');
    			    	}else{
    			    		// left
    				    	echo('col-md-9');
    			    	}
    
    			    ?>">
    			    	<?php if(term_description() != '') : ?>
    			    		<p class="description"><?php echo term_description() ?></p>
    			    	<?php endif; ?>
    
    <!-- part-archive -->
    
    <div class="archive">
    
    	<?php if (have_posts()) : ?>
    
    		<?php
    		    // category id ('43')
    		    query_posts(array(
    		        'post_type' => 'event',
    			'orderby'=> 'date',
    			'order'=> 'DESC',
    		        'tax_query' => array(
    				    array(
    				        'taxonomy' => 'event-category',
    				        'field' => 'slug',
    				        'terms' => 'flasco-events', // exclude FLASCO Events from main events archive
    				        'operator' => 'NOT IN')
    				    ),
    		    ) );
    		?>
    
    	<?php while (have_posts()) : the_post(); ?>
    
    		<article <?php post_class('row') ?>>
    
    			<div class="col-md-4 col-sm-4">
    				<a href="<?php the_permalink() ?>"><?php
    			    if( has_post_thumbnail() ){
    			    	the_post_thumbnail('mini', array('class' => 'img-responsive h2 center-block img-padder'));
    			    }else{
    				   	echo('<img width="400" height="300" src="http://placehold.it/400x300&text='. get_the_title() .'" class="img-responsive h2 center-block img-padder">');
    			    }?></a>
    			</div>
    			<div class="col-md-8 col-sm-8">
    
    				<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    
    				<div class="event-entry-meta">
    
    					<!-- Output the date of the occurrence-->
    					<?php
    						//Format date/time according to whether its an all day event.
    						//Use microdata https://support.google.com/webmasters/bin/answer.py?hl=en&answer=176035
     						if( eo_is_all_day() ){
    							$format = 'd F Y';
    							$microformat = 'Y-m-d';
    						}else{
    							$format = 'd F Y '.get_option('time_format');
    							$microformat = 'c';
    						}?>
    						<time itemprop="startDate" datetime="<?php eo_the_start($microformat); ?>"><?php eo_the_start($format); ?></time>
    
    					<!-- Display event meta list -->
    					<?php echo eo_get_event_meta_list(); ?>
    
    					<!-- Show Event text as 'the_excerpt' or 'the_content' -->
    					<?php the_excerpt(); ?>
    
    				<div class="row">
    					<div class="col-md-4 col-md-offset-8 col-xs-12">
    
    						<a href="<?php the_permalink() ?>" class="btn btn-primary btn-block">
    							<?php _e('Continue reading', 'medicals') ?> <i class="fa fa-caret-right"></i>
    						</a>
    
    					</div>
    				</div>
    
    			</div>
    
    		</article>
    
    	<?php endwhile; ?>
    
    	<div class="row">
    		<div class="nav-previous text-left col-md-6">
    			<?php next_posts_link( '<button class="btn btn-default">'.__('Older posts', 'medicals').'</button>' ); ?>
    		</div>
    
    		<div class="nav-next text-right col-md-6">
    			<?php previous_posts_link( '<button class="btn btn-default">'.__('Newer posts', 'medicals').'</button>' ); ?>
    		</div>
    	</div>
    
    	<?php else : ?>
    
    		<h2><?php _e('The content you are looking for is not found: try searching with different keywords or back to home page to navigate through the content.', 'medicals') ?></h2>
    
    	<?php endif; ?>
    
    </div>
    
    <!-- end part-archive -->
    
    				</main>
    
    				<?php if($iw_opt['archive_sidebar'] != '1' ) : ?>
    				<aside class="col-md-3 <?php if($iw_opt['archive_sidebar'] == '2' ){ echo "col-md-pull-9"; } ?>">
    					<?php get_sidebar('archive') ?>
    				</aside>
    				<?php endif; ?>
    
    			</div>
    
    		</section>
    
    <?php get_footer(); ?>

    Any one see the error? Or know where I can find the fix?

    https://wordpress.org/plugins/event-organiser/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Events Not In Chronological Order’ is closed to new replies.