Advertisement
Guest User

Untitled

a guest
Jan 30th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. <?php
  2. // Options
  3. $date_option = get_option( 'date_format' );
  4. $time_option = get_option( 'time_format' );
  5. $temp_month = '';
  6. if ( have_posts() ) :
  7. // allow other stuff
  8. do_action( 'AHEE__espresso_grid_template_template__before_loop' );
  9. ?>
  10. <div id="mainwrapper" class="espresso-grid">
  11. <?php
  12. // Start the Loop.
  13. while ( have_posts() ) : the_post();
  14. // Include the post TYPE-specific template for the content.
  15. global $post;
  16.  
  17. //Debug
  18. //d( $post );
  19.  
  20. //Create the event link
  21. $button_text = !isset($button_text) ? __('Register Now!', 'event_espresso') : $button_text;
  22. $alt_button_text = !isset($alt_button_text) ? __('View Details', 'event_espresso') : $alt_button_text;//For alternate registration pages
  23. $external_url = $post->EE_Event->external_url();
  24. $button_text = !empty($external_url) ? $alt_button_text : $button_text;
  25. $registration_url = !empty($external_url) ? $post->EE_Event->external_url() : $post->EE_Event->get_permalink();
  26. $feature_image_url = $post->EE_Event->feature_image_url(array(400,400));
  27.  
  28. if(!isset($default_image) || $default_image == '') {
  29. $default_image = EE_GRID_TEMPLATE_URL .'/images/default.jpg';
  30. }
  31.  
  32. $image = !empty($feature_image_url) ? $feature_image_url : $default_image;
  33.  
  34. //Debug
  35. //d( $post );
  36.  
  37.  
  38. ?>
  39.  
  40.  
  41. <div class="ee_grid_box item">
  42. <a id="a_register_link-<?php echo $post->ID; ?>" href="<?php echo $registration_url; ?>">
  43. <img src="<?php echo $image; ?>" alt="" />
  44.  
  45. <div id="eetitlecap" style="background: transparent;"><?php echo $post->post_title.'<br />';
  46. echo '<div class="ee_grid_date">', espresso_event_date( $date_option, $time_option ),'</div>';
  47. if($event->event_cost === "0.00") {
  48. echo __('FREE', 'event_espresso');
  49. }
  50. ?></div>
  51. </a>
  52.  
  53.  
  54. </div>
  55.  
  56. <?php
  57.  
  58. endwhile;
  59. echo '</div>';
  60. // allow moar other stuff
  61. do_action( 'AHEE__espresso_grid_template_template__after_loop' );
  62.  
  63. else :
  64. // If no content, include the "No posts found" template.
  65. espresso_get_template_part( 'content', 'none' );
  66.  
  67. endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement