<?php

/**
 * The template part for displaying the post content.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package Rock
 */
$location_data = ctc_location_data();
$directions_url = $location_data['directions_url'];
$google_map = ctc_google_map(array('latitude' => $location_data['map_lat'], 'longitude' => $location_data['map_lng'], 'type' => $location_data['map_type'], 'zoom' => $location_data['map_zoom']));
if ($google_map) {
    ?>
	<div class="rock-event-full-map">
		<?php 
    echo $google_map;
    ?>
	</div>
<?php 
}
?>

<div class="entry-event-meta">

	<?php 
if ($directions_url) {
    ?>
		<div class="rock-event-full-direction">
			<a href="<?php 
    echo esc_url($directions_url);
Exemple #2
0
    ?>
</h1>
    <?php 
}
// Get posts
$posts = ctc_get_locations($instance);
// Loop Posts
$i = 0;
foreach ($posts as $post) {
    setup_postdata($post);
    $i++;
    $ctc_location_address = ctc_location_data()['address'];
    $ctc_location_show_directions_link = ctc_location_data()['show_directions_link'];
    $ctc_location_phone = ctc_location_data()['phone'];
    $ctc_location_times = ctc_location_data()['times'];
    $ctc_location_directions_url = ctc_location_data()['directions_url'];
    ?>

      <div class="fb-locations--location">
        <?php 
    if ($instance['show_map']) {
        ?>
          <div class="fb-locations--location-map">
            <iframe class="fb-locations--location-map-embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.it/maps?q=<?php 
        echo urlencode($ctc_location_address);
        ?>
&output=embed"></iframe>
            <?php 
        if ($instance['show_address'] && $ctc_location_directions_url) {
            ?>
              <a href="<?php 
 */
// No direct access
if (!defined('ABSPATH')) {
    exit;
}
// HTML Before
echo $args['before_widget'];
// Title
$title = apply_filters('widget_title', $instance['title']);
if (!empty($title)) {
    echo $args['before_title'] . $title . $args['after_title'];
}
// Get posts
$posts = $this->ctc_get_posts();
// widget's default query according to field values
// Loop Posts
$i = 0;
foreach ($posts as $post) {
    setup_postdata($post);
    $i++;
    // Get location meta data
    // $address, $show_directions_link, $directions_url, $phone, $times, $map_lat, $map_lng, $map_type, $map_zoom
    extract(ctc_location_data());
    ?>

	<article <?php 
    post_class('ctc-widget-entry ctc-location-widget-entry ctc-clearfix' . (1 == $i ? ' ctc-widget-entry-first' : ''));
    ?>
>
		<header class="ctc-clearfix">
			<?php