-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive-wpmt_performance.php
121 lines (87 loc) · 2.67 KB
/
archive-wpmt_performance.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
* @package WordPress
* @subpackage CinemaSalem v1
*/
$debug = false; //set debug mode
get_header(); ?>
<div class="content_narrow" id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( ! get_field( 'wpmt_performance_hide' ) ) {
// displays the performance
wpmt_cs_display_performance_listing();
}
?>
<?php endwhile; else: ?>
<p><strong>Your requested post cannot be found.</strong><br /></p>
<p><a href="<?php bloginfo('blog_url'); ?>">Return to the homepage</a></p>
<?php endif; ?>
<div id="clear" class="clear"> </div>
</div><!-- end #content -->
<?php get_footer(); ?>
<?php
function wpmt_cs_display_performance_listing() { ?>
<div class="wpmt_performance_container">
<div class="wpmt_performance_thumbnail_container">
<a href="<?php the_permalink(); ?>">
<?php
if ( get_field( 'wpmt_performance_poster' ) ) {
echo wp_get_attachment_image(get_field('wpmt_performance_poster'),
$size = 'wpmt_poster',
$icon = false,
$attr = array('alt' => get_the_title($post), 'title' => get_the_title($post), 'id' => 'poster')
);
}
else {
echo '<img src="http://placehold.it/134x193?text=Performance+Thumbnail" id="thumbnail">';
}
?>
</a>
</div>
<div class="wpmt_performance_info_container">
<div class="wpmt_performance_title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div>
<div class="wpmt_performance_rating">
<?php
echo "<h4>";
if ( get_field('wpmt_performance_genre') ) {
the_field('wpmt_performance_genre');
echo '<br />';
}
if ( get_field('wpmt_performance_rating') ) {
the_field('wpmt_performance_rating');
}
if ( get_field('wpmt_performance_rating') && get_field('wpmt_performance_duration') ) {
echo " / ";
}
if ( get_field('wpmt_performance_duration') ) {
the_field('wpmt_performance_duration'); echo " mins";
}
echo "<h4>";
?>
</div>
<div class="wpmt_performance_description">
<p>
<?php echo wp_trim_words( get_field( 'wpmt_performance_synopsis'), 40, '...' ); ?>
<a href="<?php the_permalink(); ?>">[MORE]</a>
</p>
</div>
Buy Tickets
<div class="fs_showtimes">
<?php
global $post;
$backup = clone $post;
if ( wpmt_sessions_exist ( get_field( 'wpmt_performance_id' ) ) ) {
wpmt_display_sessions ( get_field( 'wpmt_performance_id' ), 2 );
$post = clone $backup;
}
else {
$post = clone $backup;
echo "No tickets available at this time";
}
?>
</div>
</div> <!-- end wpmt_performance_info_container -->
</div> <!-- end wpmt_performance_container -->
<?php } //end wpmt_cs_display_performance_listing ?>