🏠 Root
/
home
/
artorgp
/
www
/
wp-content
/
themes
/
olorun
/
Editing: single-place.php
<?php /** * The template for displaying all single persons * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ get_header(); while ( have_posts() ) : the_post(); $current_ID = get_the_ID(); $place_country = get_the_terms($current_ID, 'country'); $opening_time = get_field('opening_time'); $place_information = get_field('place_information'); $place_map = get_field('place_map'); $adress = explode( "," , $place_map['address']); $website = get_field('website'); if(get_field('instagram')) { $social['instagram'] = get_field('instagram'); } if(get_field('facebook')) { $social['facebook'] = get_field('facebook'); } if(get_field('twitter')) { $social['twitter'] = get_field('twitter'); } if(get_field('linkedin')) { $social['linkedin'] = get_field('linkedin'); } if(get_field('video')) { $social['video'] = get_field('video'); } if(get_field('a54_img_1')) { $gallery['img_1'] = get_field('a54_img_1'); } if(get_field('a54_img_2')) { $gallery['img_2'] = get_field('a54_img_2'); } if(get_field('a54_img_3')) { $gallery['img_3'] = get_field('a54_img_3'); } if(get_field('a54_img_4')) { $gallery['img_4'] = get_field('a54_img_4'); } if(get_field('a54_img_5')) { $gallery['img_5'] = get_field('a54_img_5'); } ?> <script> // Open the Modal function openModal() { document.getElementById("myModal").style.display = "block"; } // Close the Modal function closeModal() { document.getElementById("myModal").style.display = "none"; } var slideIndex = 1; // Next/previous controls function plusSlides(n) { showSlides(slideIndex += n); } // Thumbnail image controls function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName("mySlides"); var captionText = document.getElementById("caption"); var images = document.getElementsByClassName("myImages"); if (n > slides.length) {slideIndex = 1} if (n < 1) {slideIndex = slides.length} for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } slides[slideIndex-1].style.display = "block"; captionText.innerHTML = images[slideIndex-1].alt; } </script> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <ol class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a itemprop="item" href="<?php echo site_url(); ?>/"> <span itemprop="name"><?php bloginfo( 'name' ); ?></span> <meta itemprop="position" content="1"> </a> </li> > <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a itemprop="item" href="https://art54.org/holorun/"> <span itemprop="name">Holorun</span> <meta itemprop="position" content="2"> </a> </li> > <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a itemprop="item" href="https://art54.org/holorun/list-places/"> <span itemprop="name">Lieux d'exposition</span> <meta itemprop="position" content="3"> </a> </li> </ol> <h1><?php the_title(); ?></h1> <?php if ( !empty($social) || !empty($website) ) { if ( !empty($social) ) { echo '<div class="side-contact">'; echo '<ul class="my-social-menu">'; foreach($social as $key => $value) { ?> <li> <a class="instagram" target="_blank" href="<?php echo $value; ?>"> <i class="fa-<?php echo $key; ?>" title="<?php echo $key; ?>"></i> </a> </li> <?php } echo "</ul>"; } if($website) { echo '<a href="'.$website.'" target="_blank" class="aside-website">Site web officiel</a>'; } echo '</div>'; } ?> <?php if($place_country) { echo '<p class="mb-25">'; foreach($place_country as $country) { echo '<a class="country" href="https://art54.org/country/'.$country->slug.'">'.$country->name.'</a>'; } echo '</p>'; } ?> <?php if(!empty($place_map)) { ?> <p><i class="fas fa-map-marker-alt"></i><?php echo $adress[0] . ', ' . $adress[1] . ', ' . $adress[2] . '. <a onclick="showMap()" class="green-link" id="button-show">Afficher sur la carte</a>.'; ?></p> <?php } ?> <?php if(!empty($place_map)) { ?> <div class="acf-map" id="country-map" style="display: none;" data-zoom="10"> <div class="marker" data-lat="<?php echo $place_map['lat']; ?>" data-lng="<?php echo $place_map['lng']; ?>" data-title="<?php echo $adresse; ?>"></div> </div> <?php } ?> <?php the_content(); if(!empty( $gallery )) { echo '<div class="gallery">'; $i = 1; foreach($gallery as $key => $value) { echo '<img src="'. esc_url($value['sizes']['thumbnail']).'" alt="'. esc_attr($value['alt']).'" title="'. esc_attr($value['title']).'" onclick="openModal();currentSlide('.$i.')" />'; $i++; } echo '</div>'; } ?> <?php if(!empty( $gallery )) { ?> <div id="myModal" class="modal"> <span class="close cursor" onclick="closeModal()">×</span> <div class="modal-content"> <?php foreach($gallery as $key => $value) { ?> <div class="mySlides"> <img src="<?php echo esc_url($value['url']); ?>" title="<?php echo esc_attr($value['title']); ?>" alt="<?php echo esc_attr($value['alt']); ?>" style="width:100%" class="myImages" /> </div> <?php } ?> <a class="prev" onclick="plusSlides(-1)">❮</a> <a class="next" onclick="plusSlides(1)">❯</a> <!-- Caption text --> <div class="caption-container"> <p id="caption"></p> </div> </div> </div> <?php } ?> <?php if($opening_time || $place_information) { ?> <section class="grid"> <?php if($opening_time) { ?> <aside> <h2>Horaires d'ouverture</h2> <?php echo $opening_time; ?> </aside> <?php } if($place_information) { ?> <aside> <h2>Informations pratiques</h2> <?php echo $place_information; ?> </aside> <?php } ?> </section> <?php } ?> <section class="grid"> <aside> <h2>Artistes représentés</h2> <p>(A venir).</p> </aside> <aside> <h2>Commissaires d'exposition</h2> <p>(A venir).</p> </aside> </section> </main><!-- #main --> </div><!-- #primary --> <?php endwhile; ?> <?php get_footer();
Save
Cancel