Advertisement
cosmocanuck

Event Organizer code from archive-event.php

Jun 30th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. <?php /* Start the Loop */ ?>
  2.  
  3. <?php while ( have_posts() ) : the_post(); ?>
  4.  
  5. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  6. <header class="entry-header">
  7.  
  8. <h1 class="entry-title" style="display: inline;">
  9. <?php
  10. //If it has one, display the thumbnail
  11. the_post_thumbnail('thumbnail', array('style'=>'float:left;margin-right:20px;'));
  12. ?>
  13. <a href="<?php the_permalink(); ?>"><?php the_title();?></a>
  14. </h1>
  15.  
  16. <div class="event-entry-meta">
  17.  
  18. <!-- Output the date of the occurrence-->
  19. <?php
  20. //Format date/time according to whether its an all day event.
  21. //Use microdata https://support.google.com/webmasters/bin/answer.py?hl=en&answer=176035
  22. if( eo_is_all_day() ){
  23. $format = 'F d, Y';
  24. $microformat = 'Y-m-d';
  25. }else{
  26. $format = 'd F Y '.get_option('time_format');
  27. $microformat = 'c';
  28. }?>
  29. <!-- <time itemprop="startDate" datetime="<?php eo_the_start($microformat); ?>"><?php eo_the_start($format); ?></time> -->
  30.  
  31. <?php echo 'Run: ' . eo_get_schedule_start('M j, Y') . ' &mdash; ' . eo_get_schedule_last('M j, Y') . ' ' ; ?>
  32.  
  33.  
  34. <?php
  35.  
  36. /* DATE-BASED NOTICES */
  37. $today = new DateTime( 'today', eo_get_blog_timezone() );
  38. $last = eo_get_schedule_last( DATETIMEOBJ );
  39. $lastTodayDiff = (int) eo_date_interval( $last, $today, '%a' );
  40.  
  41. if ( $today == $last ) { // ends today
  42. $messageBox = "<span class='notice finalNight'>Final&nbsp;Night</span>";
  43. }
  44.  
  45. if ( ($lastTodayDiff > 0 && $lastTodayDiff < 4) && $today < $last ) {
  46. $messageBox = "<span class='notice endsSoon'>Ends&nbsp;Soon</span>";
  47. }
  48.  
  49. if ( $messageBox ) {
  50. echo $messageBox;
  51. }
  52.  
  53. $messageBox = '';
  54.  
  55. ?>
  56.  
  57.  
  58.  
  59.  
  60.  
  61. <!-- Display event meta list -->
  62. <?php echo eo_get_event_meta_list(); ?>
  63.  
  64. <!-- Show Event text as 'the_excerpt' or 'the_content' -->
  65. <?php echo apply_filters('the_excerpt',get_the_excerpt().'&nbsp;<a href="'.get_permalink().'"><strong>Read more</strong></a>'); ?>
  66.  
  67. </div><!-- .event-entry-meta -->
  68.  
  69. <div style="clear:both;"></div>
  70. </header><!-- .entry-header -->
  71.  
  72.  
  73.  
  74. </article><!-- #post-<?php the_ID(); ?> -->
  75.  
  76.  
  77. <?php endwhile; ?><!--The Loop ends-->
  78.  
  79.  
  80. <?php echo adrotate_group(1); ?>
  81.  
  82.  
  83. <!-- Navigate between pages-->
  84. <?php
  85. if ( $wp_query->max_num_pages > 1 ) : ?>
  86. <nav id="nav-below">
  87. <div class="nav-next events-nav-newer"><?php next_posts_link( __( 'Later events <span class="meta-nav">&rarr;</span>' , 'eventorganiser' ) ); ?></div>
  88. <div class="nav-previous events-nav-newer"><?php previous_posts_link( __( ' <span class="meta-nav">&larr;</span> Newer events', 'eventorganiser' ) ); ?></div>
  89. </nav><!-- #nav-below -->
  90. <?php endif; ?>
  91.  
  92. <?php else : ?>
  93. <!-- If there are no events -->
  94. <article id="post-0" class="post no-results not-found">
  95. <header class="entry-header">
  96. <h1 class="entry-title"><?php _e( 'Nothing Found', 'eventorganiser' ); ?></h1>
  97. </header><!-- .entry-header -->
  98.  
  99. <div class="entry-content">
  100. <p><?php _e( 'Apologies, but no results were found for the requested archive. ', 'eventorganiser' ); ?></p>
  101. </div><!-- .entry-content -->
  102. </article><!-- #post-0 -->
  103.  
  104. <?php endif; ?>
  105. </article>
  106.  
  107. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement