Guest User

Untitled

a guest
Nov 7th, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.17 KB | None | 0 0
  1. <?php
  2. /**
  3.  * This template will display a single event - copy it to your theme folder
  4.  *
  5.  * @ package        Event Espresso
  6.  * @ author     Seth Shoultes
  7.  * @ copyright  (c) 2008-2013 Event Espresso  All Rights Reserved.
  8.  * @ license        http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
  9.  * @ link           http://www.eventespresso.com
  10.  * @ version        4+
  11.  */
  12.  
  13. /*************************** IMPORTANT *************************
  14.  * if you are creating a custom template based on this file,
  15.  * and do not wish to use the template display order controls in the admin,
  16.  * then change the following filter to:
  17.  * add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_true' );
  18.  * comment out calls to the_content() and espresso_event_content_or_excerpt()
  19.  * then UN-comment and position the additional template parts
  20.  * that are loaded via the espresso_get_template_part() function to your liking
  21.  * and/or use any of the template tags functions found in:
  22.  * \wp-content\plugins\event-espresso-core\public\template_tags.php
  23.  ************************** IMPORTANT **************************/
  24. add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_true' );
  25.  
  26. //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' &nbsp; <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>';
  27.  
  28. global $post;
  29. $event = EEH_Event_View::get_event();
  30. $event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : '';
  31. $event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class );
  32. ?>
  33. <?php do_action( 'AHEE_event_details_before_post', $post ); ?>
  34. <article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>>
  35.  
  36. <?php if ( is_archive() ) : ?>
  37.         <div class="kgm-single-course-box">
  38.  
  39.             <div class="kgm-course-title">
  40.                 <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?>
  41.             </div>
  42.  
  43.             <div class="kgm-course-details">
  44.                 <?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?>
  45.                 <?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?>
  46.                 <span class="dashicons dashicons-groups"></span><?php $keyvalue2 = get_post_meta( get_the_ID(), 'Ages', true );
  47.                 // Check if the custom field has a value.
  48.                 if ( ! empty( $keyvalue2 ) ) {
  49.                     echo 'Ages: ' , $keyvalue2;
  50.                 } ?>
  51.             </div>
  52.  
  53.             <div id="espresso-event-thumbnail" class="kgm-course-thumbnail">
  54.                 <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?>
  55.             </div>
  56.  
  57.             <div class="kgm-course-desc">
  58.                
  59.                 <div class="kgm-course-desc-text">
  60.                     <?php if ( $event instanceof EE_Event ) {echo $event->description();}
  61.                             if ( ! $event instanceof EE_Event ) {var_dump($post);}?>
  62.                 </div>
  63.                 <div class="kgm-course-register-bttn"><?php if ( $event instanceof EE_Event ) {espresso_view_details_btn($event);} ?></div>
  64.                 <?php $keyvalue = get_post_meta( get_the_ID(), 'Barcode', true );
  65.                 // Check if the custom field has a value.
  66.                 if ( ! empty( $keyvalue ) ) {
  67.                     echo 'Barcode: ' , $keyvalue;
  68.                 } ?>
  69.             </div>
  70.  
  71.         </div>
  72.  
  73. <?php endif; ?>
  74.  
  75. </article>
  76. <!-- #post -->
  77. <?php do_action( 'AHEE_event_details_after_post', $post );
  78.  
  79.  
Add Comment
Please, Sign In to add comment