• I inherited a client website that is utilizing the Event Organiser plugin. The previous developer seems to have already created the page templates within the theme directory and customized them.

    The problem is – none of the events show up in chronological order. It isn’t in any “real” order at all. I attempted editing page templates to order by start date and desc/asc – etc. – This did not fix this issue though.

    Anyone have any idea where I can find setting or code to edit to fix this?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter rebecca-paisley

    (@rebecca-paisley)

    Events.php

    <?php
    /**
     * The template for displaying lists of events
     *
     * Queries to do with events will default to this template if a more appropriate template cannot be found
     *
     ***************** NOTICE: *****************
     *  Do not make changes to this file. Any changes made to this file
     * will be overwritten if the plug-in is updated.
     *
     * To overwrite this template with your own, make a copy of it (with the same name)
     * in your theme directory.
     *
     * WordPress will automatically prioritise the template in your theme directory.
     ***************** NOTICE: *****************
     *
     * @package Event Organiser (plug-in)
     * @since 1.0.0
     */
    
     /*
    
    Template Name: Events
    
    */
    
    //Call the template header
    get_header(); ?>
    
    <!-- This template follows the TwentyTwelve theme-->
    <div id="primary" class="site-content">
    	<div id="content" role="main">
    
    		<!-- Page header-->
    		<header class="page-header">
    		<h1 class="page-title">
    			<?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>
    		</header>
    
    		<?php if ( have_posts() ) : ?>
    
    			<!-- Navigate between pages-->
    			<!-- In TwentyEleven theme this is done by twentyeleven_content_nav-->
    			<?php
    			global $wp_query;
    			if ( $wp_query->max_num_pages > 1 ) : ?>
    				<nav id="nav-above">
    					<div class="nav-next events-nav-newer"><?php next_posts_link( __( 'Later events <span class="meta-nav">&rarr;</span>' , 'eventorganiser' ) ); ?></div>
    					<div class="nav-previous events-nav-newer"><?php previous_posts_link( __( ' <span class="meta-nav">&larr;</span> Newer events', 'eventorganiser' ) ); ?></div>
    				</nav><!-- #nav-above -->
    			<?php endif; ?>
    
    			<?php /* Start the Loop */ ?>
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    			<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    				<header class="entry-header">
    
    				<h1 class="entry-title" style="display: inline;">
    				<?php
    					//If it has one, display the thumbnail
    					the_post_thumbnail('thumbnail', array('style'=>'float:left;margin-right:20px;'));
    				?>
    				<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
    				</h1>
    
    				<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><!-- .event-entry-meta -->			
    
    				<div style="clear:both;"></div>
    				</header><!-- .entry-header -->
    
    			</article><!-- #post-<?php the_ID(); ?> -->
    
        		<?php endwhile; ?><!--The Loop ends-->
    
    		<!-- Navigate between pages-->
    		<?php
    			if ( $wp_query->max_num_pages > 1 ) : ?>
    				<nav id="nav-below">
    					<div class="nav-next events-nav-newer"><?php next_posts_link( __( 'Later events <span class="meta-nav">&rarr;</span>' , 'eventorganiser' ) ); ?></div>
    					<div class="nav-previous events-nav-newer"><?php previous_posts_link( __( ' <span class="meta-nav">&larr;</span> Newer events', 'eventorganiser' ) ); ?></div>
    				</nav><!-- #nav-below -->
    			<?php endif; ?>
    
    		<?php else : ?>
    			<!-- If there are no events -->
    			<article id="post-0" class="post no-results not-found">
    				<header class="entry-header">
    					<h1 class="entry-title"><?php _e( 'Nothing Found', 'eventorganiser' ); ?></h1>
    				</header><!-- .entry-header -->
    
    				<div class="entry-content">
    					<p><?php _e( 'Apologies, but no results were found for the requested archive. ', 'eventorganiser' ); ?></p>
    				</div><!-- .entry-content -->
    			</article><!-- #post-0 -->
    
    			<?php endif; ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <!-- Call template sidebar and footer -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Archive-event.php

    <?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(); ?>
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I inherited a client website that is utilizing the Event Organiser plugin.

    Which plugin and where did it come from? I mean a URL. 😉

    Thread Starter rebecca-paisley

    (@rebecca-paisley)

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Thank you for that. Could you please repost this topic in that plugin’s dedicated support sub-forum? I’ll close this topic with a link to the new one if you do.

    https://wordpress.org/support/plugin/event-organiser#postform

    When you do that, you improve the odds of your topic being seen by the right people. Please don’t post the PHP code again, the source is already available to the plugin author.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Event Organiser – Ordering Events’ is closed to new replies.