Advertisement
cosmocanuck

shortcode-event-list.php

Aug 6th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. <?php
  2. /**
  3. * Event List Widget: Standard List
  4. *
  5. * The template is used for displaying the [eo_event] shortcode *unless* it is wrapped around a placeholder: e.g. [eo_event] {placeholder} [/eo_event].
  6. *
  7. * You can use this to edit how the output of the eo_event shortcode. See http://docs.wp-event-organiser.com/shortcodes/events-list
  8. * For the event list widget see widget-event-list.php
  9. *
  10. * For a list of available functions (outputting dates, venue details etc) see http://codex.wp-event-organiser.com/
  11. *
  12. ***************** NOTICE: *****************
  13. * Do not make changes to this file. Any changes made to this file
  14. * will be overwritten if the plug-in is updated.
  15. *
  16. * To overwrite this template with your own, make a copy of it (with the same name)
  17. * in your theme directory. See http://docs.wp-event-organiser.com/theme-integration for more information
  18. *
  19. * WordPress will automatically prioritise the template in your theme directory.
  20. ***************** NOTICE: *****************
  21. *
  22. * @package Event Organiser (plug-in)
  23. * @since 1.7
  24. */
  25. global $eo_event_loop,$eo_event_loop_args;
  26.  
  27. //Date % Time format for events
  28. $date_format = get_option('date_format');
  29. $time_format = get_option('time_format');
  30.  
  31. //The list ID / classes
  32. $id = ( $eo_event_loop_args['id'] ? 'id="'.$eo_event_loop_args['id'].'"' : '' );
  33. $classes = $eo_event_loop_args['class'];
  34.  
  35. ?>
  36.  
  37. <?php if( $eo_event_loop->have_posts() ): ?>
  38.  
  39. <ul <?php echo $id; ?> class="<?php echo esc_attr($classes);?>" >
  40.  
  41. <?php while( $eo_event_loop->have_posts() ): $eo_event_loop->the_post(); ?>
  42.  
  43. <?php
  44. //Generate HTML classes for this event
  45. $eo_event_classes = eo_get_event_classes();
  46.  
  47. //For non-all-day events, include time format
  48. $format = ( eo_is_all_day() ? $date_format : $date_format.' '.$time_format );
  49. ?>
  50.  
  51.  
  52.  
  53.  
  54.  
  55. <div class="<?php echo esc_attr(implode(' ',$eo_event_classes)); ?>" >
  56.  
  57. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  58.  
  59. <?php
  60. //If it has one, display the thumbnail
  61. the_post_thumbnail('poster-thumb', array('style'=>'float:left;margin-right:20px;'));
  62. ?>
  63.  
  64. </a>
  65.  
  66. <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a></h2>
  67.  
  68.  
  69. <!-- List date/dates of film -->
  70.  
  71. <?php
  72. $movieDates = array();
  73. while( $upcoming->have_posts() ): $upcoming->the_post();
  74. $movieDates[] = eo_get_the_start( $date_format );
  75. endwhile;
  76. echo implode( ', ', $movieDates );
  77. wp_reset_postdata();
  78. ?>
  79.  
  80.  
  81.  
  82. <?php echo apply_filters('the_excerpt',get_the_excerpt().'&nbsp;<a href="'.get_permalink().'"><strong>Read more</strong></a>'); ?>
  83. </div>
  84. <div class="clear" style="clear:both;"></div>
  85.  
  86.  
  87.  
  88.  
  89.  
  90. <?php endwhile; ?>
  91.  
  92. </ul>
  93.  
  94. <?php elseif( ! empty($eo_event_loop_args['no_events']) ): ?>
  95.  
  96. <ul id="<?php echo esc_attr($id);?>" class="<?php echo esc_attr($classes);?>" >
  97. <li class="eo-no-events" > <?php echo $eo_event_loop_args['no_events']; ?> </li>
  98. </ul>
  99.  
  100. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement