atravelblog/page-pins.php

109 lines
3.8 KiB
PHP
Raw Normal View History

2017-02-19 16:19:56 +01:00
<?php get_header(); ?>
<div class="content section-inner">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class('post single'); ?>>
<div class="post-container">
<?php if ( has_post_thumbnail() ) : ?>
<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail_size' ); $thumb_url = $thumb['0']; ?>
<div class="featured-media">
<?php the_post_thumbnail('post-image'); ?>
</div> <!-- /featured-media -->
<?php endif; ?>
<div class="post-header">
<h1 class="post-title"><?php the_title(); ?></h1>
</div>
<div class="post-inner">
2017-02-19 19:22:45 +01:00
<div class="post-content">
2017-02-19 16:19:56 +01:00
<?php the_content(); ?>
2017-02-19 19:17:12 +01:00
2017-02-25 10:11:05 +01:00
<label for="travelers-select">Mitreisende:</label>
<ul id="travelers-select"></ul>
2017-02-21 00:46:32 +01:00
2017-02-25 15:17:40 +01:00
<div id="pin-filter-action-panel">
<p>
2017-02-25 10:11:05 +01:00
<label for="time-range">Zeitraum:</label>
2017-02-25 13:39:09 +01:00
<input type="text" id="time-range" readonly>
2017-02-25 10:11:05 +01:00
</p>
2017-02-25 15:17:40 +01:00
<div id="time-range-slider"></div>
2017-02-25 09:41:16 +01:00
2017-02-25 15:17:40 +01:00
<a class="button" id="travelers-reset-button">Reset</a>
<a class="button" id="travelers-extend-button">Erweitert</a>
2017-02-25 10:11:05 +01:00
<input type="checkbox" id="toggle-and-or" />
</div>
2017-02-19 16:19:56 +01:00
<?php wp_link_pages('before=<div class="clear"></div><p class="page-links">' . __( 'Pages:', 'hitchcock' ) . ' &after=</p>&seperator= <span class="sep">/</span> '); ?>
</div> <!-- /post-content -->
<div class="clear"></div>
<?php edit_post_link(__('Edit Page','hitchcock'), '<div class="post-meta"><p class="post-edit">', '</p></div>'); ?>
</div> <!-- /post-inner -->
2017-02-19 18:06:47 +01:00
<div class="post-meta">
2017-02-21 00:53:29 +01:00
<div class='map' style='height:500px; margin-bottom: 1.6842em' id='map-stats'></div>
2017-02-19 18:06:47 +01:00
</div> <!-- /post-meta -->
2017-02-19 16:19:56 +01:00
<?php comments_template( '', true ); ?>
</div> <!-- /post-container -->
</div> <!-- /post -->
<?php endwhile; else: ?>
<p><?php _e("We couldn't find any posts that matched your query. Please try again.", "hitchcock"); ?></p>
<?php endif; ?>
<div class="clear"></div>
</div> <!-- /content -->
2017-02-19 17:07:49 +01:00
<?php
query_posts( 'category_name=urlaub&posts_per_page=10000' );
2017-02-19 17:57:40 +01:00
$locations = array();
2017-02-19 19:21:15 +01:00
$traveler = array();
2017-02-19 17:07:49 +01:00
while ( have_posts() ) : the_post();
2017-02-19 17:57:40 +01:00
$places = get_field('orte');
if($places){
2017-02-19 19:21:15 +01:00
$traveler = array_unique(array_merge($traveler, get_field('mitreisende')));
2017-02-19 17:57:40 +01:00
foreach ($places as $place){
$locations[] = array_merge(array(
"post" => $post->ID,
"title" => $post->post_title,
"traveler" => get_field('mitreisende'),
"start" => get_field('anreise'),
"end" => get_field('abreise')
), $place);
2017-02-19 17:57:40 +01:00
}
}
2017-02-19 17:07:49 +01:00
endwhile;
2017-02-25 13:45:17 +01:00
wp_enqueue_style('toggle_switch_style', get_stylesheet_directory_uri() . '/css/tinytools.toggleswitch.css');
2017-02-23 01:09:24 +01:00
wp_enqueue_script('toggle_switch', get_stylesheet_directory_uri() . '/js/tinytools.toggleswitch.min.js', array('jquery'));
2017-02-25 09:41:16 +01:00
wp_enqueue_script('page_pins_map', get_stylesheet_directory_uri() . '/js/page-pins-map.js', array('jquery', 'jquery-ui-selectable', 'jquery-ui-slider', 'toggle_switch'));
2017-02-20 23:29:54 +01:00
wp_localize_script('page_pins_map', 'page_pins_map', array('places' => $locations, 'traveler' => array_values($traveler)));
2017-02-21 00:06:42 +01:00
wp_enqueue_style('page_pins', get_stylesheet_directory_uri() . '/css/page-pins.css');
2017-02-25 09:58:32 +01:00
wp_enqueue_style('jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css', false, null, false);
2017-02-19 17:07:49 +01:00
?>
2017-02-19 16:19:56 +01:00
2017-02-20 23:32:28 +01:00
<?php get_footer(); ?>