-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-location.php
92 lines (64 loc) · 2.41 KB
/
content-location.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
<?php
/**
* Location content for:
*
* 1. Full / Single
* 2. Short / Multiple
*/
// No direct access
if ( ! defined( 'ABSPATH' ) ) exit;
// Get data
// $address, $show_directions_link, $directions_url, $phone, $times, $map_lat, $map_lng, $map_type, $map_zoom
extract( ctfw_location_data() );
/*************************************
* 1. FULL / SINGLE
*************************************/
if ( is_singular( get_post_type() ) ) :
$google_map = ctfw_google_map( array(
'latitude' => $map_lat,
'longitude' => $map_lng,
'type' => $map_type,
'zoom' => $map_zoom
) );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'uplifted-entry-full uplifted-location-full' ); ?>>
<?php get_template_part( 'content-location-header' ); ?>
<?php if ( $google_map ) : ?>
<div class="uplifted-location-full-map">
<?php echo $google_map; ?>
</div>
<?php endif; ?>
<?php if ( $directions_url ) : ?>
<div class="uplifted-location-full-direction">
<a href="<?php echo esc_url( $directions_url ); ?>" target="_blank" class="uplifted-button">
<i class="genericon genericon-location"></i>
<?php _ex( 'Get Directions', 'location', 'uplifted' ); ?>
</a>
</div>
<?php endif; ?>
<?php if ( ctfw_has_content() ) : // might not be any content, so let header sit flush with bottom ?>
<div class="uplifted-entry-content uplifted-clearfix">
<?php the_content(); ?>
<?php do_action( 'uplifted_after_content' ); ?>
</div>
<?php endif; ?>
<?php get_template_part( 'content-footer-full' ); // multipage nav, term lists, "Edit" button, etc. ?>
</div> <!-- /uplifted-content-meta -->
</article>
<?php
/*************************************
* 2. SHORT / MULTIPLE
*************************************/
else :
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'uplifted-entry-short uplifted-location-short' ); ?>>
<?php get_template_part( 'content-location-header' ); ?>
<?php if ( ctfw_has_excerpt() || ctfw_has_more_tag() ) : ?>
<div class="uplifted-entry-content uplifted-clearfix">
<?php uplifted_short_content(); // output excerpt or post content up until <!--more--> quicktag used ?>
</div>
<?php endif; ?>
<?php get_template_part( 'content-footer-short' ); // show appropriate button(s) ?>
</div> <!-- /uplifted-content-meta -->
</article>
<?php endif; ?>