-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-footer-short.php
194 lines (137 loc) · 5.06 KB
/
content-footer-short.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?php
/**
* Short Content Footer
*
* Show appropriate button(s) beneath short display of post in loop.
*/
// No direct access
if ( ! defined( 'ABSPATH' ) ) exit;
// Post type
$post_type = get_post_type();
?>
<footer class="uplifted-entry-footer clearfix">
<?php
// Sermon Buttons
if ( 'ctc_sermon' == $post_type ) :
// Get sermon meta data
// $has_full_text True if full text of sermon was provided as post content
// $video_player Embed code generated from uploaded file, URL for file on other site, page on oEmbed-supported site such as YouTube, or manual embed code (HTML or shortcode)
// $video_download_url URL for download link (available only for local files, "Save As" will be forced)
// $audio_player Same as video
// $audio_download_url Same as video
// $pdf_download_url URL for download link (local or externally hosted, but "Save As" forced only if local)
extract( ctfw_sermon_data() );
?>
<a class="view-details" href="<?php the_permalink(); ?>">
<?php if ( $has_full_text ) : ?>
<?php _e( 'Read Full →', 'uplifted' ); ?>
<?php else : ?>
<?php _ex( 'View Details →', 'sermon button', 'uplifted' ); ?>
<?php endif; ?>
</a>
<ul class="uplifted-entry-footer-item uplifted-list-buttons">
<?php
// Make sure there is no whitespace between items since they are inline-block
?>
<?php
if ( $video_player || $video_download_url ) :
?><li>
<a href="<?php the_permalink(); ?><?php if ( $video_player ) : ?>?player=video<?php endif; ?>">
<i class="genericon genericon-video"></i>
<?php _e( 'Watch', 'uplifted' ); ?>
</a>
</li><?php
endif;
if ( $audio_player || $audio_download_url ) :
?><li>
<a href="<?php the_permalink(); ?><?php if ( $audio_player ) : ?>?player=audio<?php endif; ?>">
<i class="genericon genericon-audio"></i>
<?php _e( 'Listen', 'uplifted' ); ?>
</a>
</li><?php
endif;
if ( $pdf_download_url ) :
?><li>
<a href="<?php echo esc_url( $pdf_download_url ); ?>" title="<?php echo esc_attr( __( 'Download PDF', 'uplifted' ) ); ?>">
<i class="genericon genericon-cloud-download"></i>
<?php _e( 'PDF', 'uplifted' ); ?>
</a>
</li><?php
endif;
?>
</ul>
<?php
// Location Buttons
elseif ( 'ctc_location' == $post_type ) :
// Get data
// $address, $show_directions_link, $directions_url, $phone, $times, $map_lat, $map_lng, $map_type, $map_zoom
extract( ctfw_location_data() );
?>
<a class="view-details" href="<?php the_permalink(); ?>"><?php _e( 'View Details →', 'uplifted' ); ?></a>
<ul class="uplifted-entry-footer-item uplifted-list-buttons">
<?php
// Make sure there is no whitespace between items since they are inline-block
if ( $directions_url ) :
?><li><a href="<?php echo esc_url( $directions_url ); ?>" target="_blank"><i class="genericon genericon-location"></i><?php _e( 'Directions', 'uplifted' ); ?></a></li><?php
endif;
?>
</ul>
<?php
// Event Buttons
elseif ( 'ctc_event' == $post_type ) :
// Get data
// $date (localized range), $start_date, $end_date, $time, $venue, $address, $show_directions_link, $directions_url, $map_lat, $map_lng, $map_type, $map_zoom
extract( ctfw_event_data() );
?>
<a class="view-details" href="<?php the_permalink(); ?>"><?php _e( 'View Details →', 'uplifted' ); ?></a>
<ul class="uplifted-entry-footer-item uplifted-list-buttons">
<?php
// Make sure there is no whitespace between items since they are inline-block
if ( $directions_url ) :
?><li><a href="<?php echo esc_url( $directions_url ); ?>" target="_blank"><i class="genericon genericon-location"></i><?php _e( 'Directions', 'uplifted' ); ?></a></li><?php
endif;
?>
</ul>
<?php
// Person Buttons
elseif ( 'ctc_person' == $post_type ) :
?>
<?php if ( ctfw_has_content() ) : // show only if has bio content ?>
<ul class="uplifted-entry-footer-item uplifted-list-buttons">
<li><a href="<?php the_permalink(); ?>"><?php _e( 'Read Biography', 'uplifted' ); ?></a></li>
</ul>
<?php endif; ?>
<?php
// Gallery Page Button
elseif ( 'page' == $post_type && CTFW_THEME_PAGE_TPL_DIR . '/gallery.php' == $post->page_template ) :
?>
<ul class="uplifted-entry-footer-item uplifted-list-buttons">
<li>
<a href="<?php the_permalink(); ?>">
<i class="genericon genericon-gallery"></i>
<?php _e( 'View Gallery', 'uplifted' ); ?>
</a>
</li>
</ul>
<?php
// Generic Post Type Button
else :
$post_type_obj = get_post_type_object( $post->post_type );
?>
<div class="uplifted-entry-footer-item clearfix">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" class="uplifted-button">
<?php
// <!--more--> quicktag is used; show "Read More"
if ( ctfw_has_more_tag() ) :
?>
<?php _e( 'Read More', 'uplifted' ); ?>
<?php elseif ( ! empty( $post_type_obj->labels->singular_name ) ) :?>
<?php
/* translators: %s is post type name */
printf( __( 'View %s', 'uplifted' ), $post_type_obj->labels->singular_name );
?>
<?php endif; ?>
</a>
</div>
<?php endif; ?>
</footer>