🏠 Root
/
home
/
artorgp
/
www
/
wp-content
/
themes
/
olorun
/
Editing: page-list-places.php
<?php /** Template Name: Template listing des lieux * * If the user has selected a static page for their homepage, this is what will appear. * Learn more: https://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Base theme developped by Arthur H. * @version 1.0 */ get_header(); while ( have_posts() ) : the_post(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php echo '<h1>'.get_the_title().'</h1>'; ?> <?php /* <button onclick="changeView()" id="change-view">Lister par ordre alphabetique.</button> */ ?> <?php the_content(); ?> <?php $query_places = array( 'post_type' => 'place', 'post_status' => 'publish', 'posts_per_page'=> -1, 'orderby' => 'date', 'order' => 'DESC', ); $i = 0; $query_places = new WP_Query($query_places); if(!empty($query_places)) { while ($query_places->have_posts()) { $query_places->the_post(); $place_location = get_field('place_map', get_the_id()); if(!empty($place_location)) { $all_place_locations[$i] = array( 'lat' => $place_location['lat'], 'lng' => $place_location['lng'], 'title' => get_the_title(get_the_id()), 'url' => get_permalink(get_the_id()), ); } $i++; } ?> <div class="acf-map" data-zoom="10"> <?php foreach($all_place_locations as $single_place){ ?> <div class="marker" data-lat="<?php echo $single_place['lat']; ?>" data-lng="<?php echo $single_place['lng']; ?>" data-title="<?php echo $single_place['title']; ?>" data-url="<?php echo $single_place['url']; ?>"></div> <?php } ?> </div> <?php } wp_reset_postdata(); ?> <?php /* <section id="last-elements" style="display:block;"> <?php $query_artists = array( 'post_type' => 'place', 'post_status' => 'publish', 'posts_per_page'=> 10, 'orderby' => 'date', 'order' => 'DESC', ); $query_artists = new WP_Query($query_artists); if($query_artists->have_posts()): echo '<div class="gallery gallery-list flex-center">'; while ($query_artists->have_posts()) : $query_artists->the_post(); echo '<article>'; $gallerymage = get_field('a54_img_1'); echo '<a href="'.get_the_permalink().'"><img src="'. (($gallerymage) ? esc_url($gallerymage['sizes']['thumbnail']) : 'https://art54.org/wp-content/uploads/fond-vert.jpg') .'" alt="'. esc_attr($value['alt']).'" title="'. esc_attr($value['title']).'" /></a>'; echo '<a href="'.get_the_permalink().'">'.get_the_title().'</a>'; echo '</article>'; endwhile; echo '</div>'; endif; wp_reset_postdata(); ?> </section> */ ?> <section id="abc-elements" style="display:none;"> <?php echo do_shortcode('[a-z-listing display="posts" post-type="person" taxonomy="role" terms="artist"]'); ?> </section> <?php endwhile; ?> </main><!-- #main --> </div><!-- #primary --> <?php get_footer(); ?>
Save
Cancel