timfurnish

modified single-event.php

Feb 19th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.73 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying a single event
  4.  *
  5.  ***************** NOTICE: *****************
  6.  *  Do not make changes to this file. Any changes made to this file
  7.  * will be overwritten if the plug-in is updated.
  8.  *
  9.  * To overwrite this template with your own, make a copy of it (with the same name)
  10.  * in your theme directory.
  11.  *
  12.  * WordPress will automatically prioritise the template in your theme directory.
  13.  ***************** NOTICE: *****************
  14.  *
  15.  * @package Event Organiser (plug-in)
  16.  * @since 1.0.0
  17.  */
  18.  
  19. //Call the template header
  20. get_header(); ?>
  21.  
  22.         <div id="content" role="main">
  23.         <div class="padder">
  24.  
  25.             <?php while ( have_posts() ) : the_post(); ?>
  26.  
  27.                 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  28.  
  29.                     <header class="entry-header">
  30.  
  31.                         <!---- Display event title-->
  32.                         <h1 class="entry-title"><?php the_title(); ?></h1>
  33.  
  34.                             <div class="entry-meta">
  35.                                 <!----Choose a different date format depending on whether we want to include time-->
  36.                                 <?php if(eo_is_all_day()): ?>
  37.                                     <!----Event is all day -->
  38.                                     <?php $date_format = 'j F Y'; ?>
  39.                                 <?php else: ?>
  40.                                     <!----Event is not all day - include time in format-->
  41.                                     <?php $date_format = 'j F Y g:ia'; ?>
  42.                                 <?php endif; ?>
  43.  
  44.                                 <?php if(eo_reoccurs()):?>
  45.                                     <!----Event reoccurs - is there a next occurrence? -->
  46.                                     <?php $next =   eo_get_next_occurrence($date_format);?>
  47.                                     <?php if($next): ?>
  48.                                         <!---- If the event is occurring again in the future, display the date -->
  49.                                         <?php printf(__('This event is running from %1$s until %2$s. It is next occurring at %3$s','eventorganiser'), eo_get_schedule_start('d F Y'), eo_get_schedule_end('d F Y'), $next);?>
  50.  
  51.                                     <?php else: ?>
  52.                                         <!---- Otherwise the event has finished (no more occurrences) -->
  53.                                         <?php printf(__('This event finished on %s','eventorganiser'), eo_get_schedule_end('d F Y',''));?>
  54.                                 <?php endif; ?>
  55.  
  56.                                 <?php else: ?>
  57.                                     <!----Event is a single event -->
  58.                                         <?php printf(__('This event is on %s','eventorganiser'), eo_get_the_start($date_format) );?>
  59.                                 <?php endif; ?>
  60.                             </div><!-- .entry-meta -->
  61.  
  62.                     </header><!-- .entry-header -->
  63.    
  64.                     <div class="entry-content">
  65.                         <!---- The content or the description of the event-->
  66.                         <?php the_content(); ?>
  67.                         <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'eventorganiser' ) . '</span>', 'after' => '</div>' ) ); ?>
  68.                     </div><!-- .entry-content -->
  69.  
  70.                     <footer class="entry-meta">
  71.                     <?php
  72.                     //Events have their own 'event-category' taxonomy. Get list of categories this event is in.
  73.                     $categories_list = get_the_term_list( get_the_ID(), 'event-category', '', ', ','');
  74.  
  75.                     if ( '' != $categories_list ) {
  76.                         $utility_text = __( 'This event was posted in %1$s by <a href="%5$s">%4$s</a>. Bookmark the <a href="%2$s" title="Permalink to %3$s" rel="bookmark">permalink</a>.', 'eventorganiser' );
  77.                     } else {
  78.                         $utility_text = __( 'This event was posted by <a href="%5$s">%4$s</a>. Bookmark the <a href="%2$s" title="Permalink to %3$s" rel="bookmark">permalink</a>.', 'eventorganiser' );
  79.                     }
  80.                     printf(
  81.                         $utility_text,
  82.                         $categories_list,
  83.                         esc_url( get_permalink() ),
  84.                         the_title_attribute( 'echo=0' ),
  85.                         get_the_author(),
  86.                         esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
  87.                     );
  88.                     ?>
  89.                     <?php edit_post_link( __( 'Edit'), '<span class="edit-link">', '</span>' ); ?>
  90.                     </footer><!-- .entry-meta -->
  91.                 </article><!-- #post-<?php the_ID(); ?> -->
  92.                        
  93.                 <?php endwhile; // end of the loop. ?>
  94.  
  95.             </div><!-- #padder -->
  96.            
  97.             </div><!-- #content -->
  98.  
  99. <!-- Call template footer -->
  100. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment