PluginProbe
Themify Event Post / trunk
Themify Event Post vtrunk
1.3.7 trunk 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6
themify-event-post / templates / single.php

single.php in Themify Event Post trunk, at templates/single.php

95 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template to display the_content for event posts
4 *
5 * To override this file copy it to <your_theme>/themify-event-post/single.php
6 *
7 * @var $content
8 */
9 $post_id = get_the_id();
10 ?>
11 <div <?php post_class( 'themify_event_post' ); ?>>
12
13 <?php
14 echo themify_event_post_get_image();
15 $image = get_the_post_thumbnail_url($post_id);
16 ?>
17
18 <?php if ( $map_address = get_post_meta( $post_id, 'map_address', true ) ) : ?>
19 <div class="tep_event_map">
20 <?php echo themify_event_post_map( array(
21 'address' => $map_address,
22 ) );
23 ?>
24 </div><!-- / .tep_event_map -->
25 <?php endif; ?>
26
27 <div class="tep_event_info">
28
29 <?php themify_event_type(); ?>
30
31 <?php
32 $title = themify_event_post_title( array(
33 'post' => $this->post,
34 'echo' => false
35 ) );
36 echo $title;
37 ?>
38
39 <?php themify_event_post_date(); ?>
40
41 <?php themify_event_organizer(); ?>
42
43 <?php themify_event_performer(); ?>
44
45 <?php if ( $location = get_post_meta( $post_id, 'location', true ) ) : ?>
46 <div>
47 <span class="tep_location">
48 <?php echo esc_html( $location ); ?>
49 </span>
50 <?php if ( $map_address = get_post_meta( $post_id, 'map_address', true ) ) : ?>
51 <span class="tep_address">
52 <?php echo wp_kses_post( $map_address ); ?>
53 </span>
54 <?php endif; ?>
55 </div>
56 <?php endif; ?>
57
58 <?php themify_event_buy_ticket(); ?>
59
60 </div><!-- / .tep_event_info -->
61
62 <div class="tep_content">
63
64 <?php echo $content; ?>
65
66 </div><!-- /.tep_content -->
67
68 <?php
69 $metadata = get_post_meta($post_id);
70 echo themify_event_post_json_ld_generator(array(
71 'name'=>get_the_title( $this->post ),
72 'start_date'=>isset($metadata['start_date'])?$metadata['start_date'][0]:'',
73 'end_date'=>isset($metadata['end_date'])?$metadata['end_date'][0]:'',
74 'place'=>$location,
75 'address'=>$map_address,
76 'image'=>$image,
77 'decription'=>trim(strip_tags($content)),
78
79 'event_attendance'=>isset($metadata['event_attendance'])?$metadata['event_attendance'][0]:'',
80 'buy_ticket'=> get_post_meta( $post_id, 'buy_tickets', true ),
81 'ticket_price'=>get_post_meta( $post_id, 'buy_tickets_price', true ),
82 'event_attendance'=>isset($metadata['event_attendance'])?$metadata['event_attendance'][0]:'',
83 'ticket_currency'=>isset($metadata['buy_tickets_currency'])?$metadata['buy_tickets_currency'][0]:'',
84 'ticket_purchase_start'=>isset($metadata['ticket_purchase_start_date'])?$metadata['ticket_purchase_start_date'][0]:'',
85 'ticket_purchase_end'=>isset($metadata['ticket_purchase_end'])?$metadata['ticket_purchase_end'][0]:'',
86 'ticket_availability'=>isset($metadata['ticket_availability'])? str_replace(array(' ', '-'), '', ucwords($metadata['ticket_availability'][0])) :'',
87 'event_status'=>isset($metadata['event_status'])?$metadata['event_status'][0]:'',
88 'organizer'=>isset($metadata['organizer'])?$metadata['organizer'][0]:'',
89 'organizer_name'=>isset($metadata['organizer_name'])?$metadata['organizer_name'][0]:'',
90 'organizer_url'=>isset($metadata['organizer_url'])?$metadata['organizer_url'][0]:'',
91 'performer'=>isset($metadata['event_performer'])?$metadata['event_performer'][0]:'',
92 'performer_name'=>isset($metadata['performer_name'])?$metadata['performer_name'][0]:'',
93 )); ?>
94 </div><!-- / .themify_event_post -->
95