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 / content.php

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

137 lines 4.9 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 an Event post in archive lists
4 *
5 * To override this file copy it to <your_theme>/themify-event-post/content.php
6 *
7 * @var $image
8 * @var $unlink_image
9 * @var $image_w
10 * @var $image_h
11 * @var $hide_event_date
12 * @var $hide_event_organizer
13 * @var $hide_event_performer
14 * @var $hide_event_location
15 * @var $hide_event_meta
16 * @var $title
17 * @var $unlink_title
18 * @var $display
19 * @var $more_link
20 * @var $more_text
21 *
22 * @package Themify Event Post
23 */
24 $post_id = get_the_ID();
25 $thumb = '';
26 $map_address = '';
27 ?>
28 <article id="post-<?php the_id(); ?>" <?php post_class( 'themify_event_post post tf_clearfix event-post' ); ?>>
29
30 <?php if ( $image === 'yes' && has_post_thumbnail() ) : ?>
31 <?php
32 echo themify_event_post_get_image( array(
33 'width' => $image_w,
34 'height' => $image_h,
35 'unlink' => $unlink_image === 'yes',
36 ) );
37 $thumb = get_the_post_thumbnail_url($post_id);
38 ?>
39 <?php endif; ?>
40
41 <div class="tep_post_content">
42
43 <?php themify_event_type(); ?>
44 <?php if ( $hide_event_meta === 'no' ) : ?>
45 <div class="tep_meta">
46 <?php if ( has_term( '', 'event-category' ) ) : ?>
47 <?php the_terms( $post_id, 'event-category', ' <span class="tep_post_category">', '<span class="tep_term_separator">,</span> ', '<i class="divider-small"></i></span>' ); ?>
48 <?php endif; ?>
49 <?php the_terms( $post_id, 'event-tag', ' <span class="tep_tags">', '<span class="tep_term_separator">,</span> ', '</span>' ); ?>
50 </div>
51 <?php endif; //post meta ?>
52
53 <?php if ( $title === 'yes' ) : ?>
54 <?php themify_event_post_title( array(
55 'unlink' => $unlink_title !== 'no',
56 'tag' => $title_tag
57 ) ); ?>
58 <?php endif; //post title ?>
59
60 <div class="tep_event_info">
61
62 <?php if ( $hide_event_date === 'no' ) : ?>
63 <?php themify_event_post_date() ?>
64 <?php endif; ?>
65
66 <?php if ( $hide_event_organizer === 'no' ) : ?>
67 <?php themify_event_organizer(); ?>
68 <?php endif; ?>
69
70 <?php if ( $hide_event_performer === 'no' ) : ?>
71 <?php themify_event_performer(); ?>
72 <?php endif; ?>
73
74 <?php if ( ( $location = get_post_meta( $post_id, 'location', true ) ) && $hide_event_location === 'no' ) : ?>
75 <div>
76 <span class="tep_location">
77 <?php echo esc_html( $location ); ?>
78 </span>
79 <?php if ( $map_address = get_post_meta( $post_id, 'map_address', true ) ) : ?>
80 <span class="tep_address">
81 <?php echo wp_kses_post( $map_address ); ?>
82 </span>
83 <?php endif; ?>
84 </div>
85 <?php endif; ?>
86
87 <?php themify_event_buy_ticket(); ?>
88
89 </div><!-- / .event-info-wrap -->
90
91 <div class="tep_content">
92 <?php if ( 'excerpt' == $display ) : ?>
93
94 <?php the_excerpt(); ?>
95
96 <?php if ( $more_link ) : ?>
97 <p>
98 <a href="<?php the_permalink(); ?>" class="more-link"><?php echo wp_kses_post( $more_text ); ?></a>
99 </p>
100 <?php endif; ?>
101
102 <?php elseif( $display != 'none' ) : ?>
103 <?php the_content(); ?>
104 <?php endif; //display content ?>
105
106 </div><!-- /.tep_content -->
107 <?php
108 $metadata = get_post_meta($post_id);
109 echo themify_event_post_json_ld_generator(array(
110 'name'=>get_the_title( $this->post ),
111 'start_date'=>isset($metadata['start_date'])?$metadata['start_date'][0]:'',
112 'end_date'=>isset($metadata['end_date'])?$metadata['end_date'][0]:'',
113 'place'=>$location,
114 'address'=>$map_address,
115 'image'=>$thumb,
116 'decription'=>trim(strip_tags( get_the_content( $more_text ) )),
117 'buy_ticket'=> get_post_meta( $post_id, 'buy_tickets', true ),
118 'event_attendance'=>isset($metadata['event_attendance'])?$metadata['event_attendance'][0]:'',
119 'ticket_price'=>get_post_meta( $post_id, 'buy_tickets_price', true ),
120 'event_attendance'=>isset($metadata['event_attendance'])?$metadata['event_attendance'][0]:'',
121 'ticket_currency'=>isset($metadata['buy_tickets_currency'])?$metadata['buy_tickets_currency'][0]:'',
122 'ticket_purchase_start'=>isset($metadata['ticket_purchase_start_date'])?$metadata['ticket_purchase_start_date'][0]:'',
123 'ticket_purchase_end'=>isset($metadata['ticket_purchase_end'])?$metadata['ticket_purchase_end'][0]:'',
124 'ticket_availability'=>isset($metadata['ticket_availability'])? str_replace(array(' ', '-'), '', ucwords($metadata['ticket_availability'][0])) :'',
125 'event_status'=>isset($metadata['event_status'])?$metadata['event_status'][0]:'',
126 'organizer'=>isset($metadata['organizer'])?$metadata['organizer'][0]:'',
127 'organizer_name'=>isset($metadata['organizer_name'])?$metadata['organizer_name'][0]:'',
128 'organizer_url'=>isset($metadata['organizer_url'])?$metadata['organizer_url'][0]:'',
129 'performer'=>isset($metadata['event_performer'])?$metadata['event_performer'][0]:'',
130 'performer_name'=>isset($metadata['performer_name'])?$metadata['performer_name'][0]:'',
131 )); ?>
132 </div><!-- .tep_post_content -->
133
134 <?php themify_event_post_edit_link(); ?>
135
136 </article>
137