🏠 Root
/
home
/
a
/
r
/
t
/
artorgp
/
www
/
wp-content
/
themes
/
olorun
/
Editing: taxonomy-city.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(); $birthdate = get_field('birth_date'); $deathdate = get_field('death_date'); $punchline = get_field('punchline'); $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="http://art54.org/olorun/list-artists/"> <span itemprop="name">Artistes</span> <meta itemprop="position" content="2"> </a> </li> </ol> <h1><?php the_title(); ?></h1> <?php if ( !empty($social) ) { 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>"; } ?> <p> <?php if($birthdate) { echo $birthdate; } if($deathdate) { echo ' - ' . $deathdate; } if($punchline) { echo ' | ' . $punchline; } if($website) { echo ' | <a href="' . $website .'" target="_blank">Site web officiel</a>'; } ?> </p> <?php the_content(); if(!empty( $gallery )) { echo '<div class="gallery">'; $i = 1; foreach($gallery as $key => $value) { echo '<img src="'. esc_url($value['sizes']['medium']).'" 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 } ?> <section class="grid"> <aside> <h2>Galleries et lieux d'expositions</h2> <p>(A venir).</p> </aside> <aside> <h2>Evénements</h2> <p>(A venir).</p> </aside> </section> </main><!-- #main --> </div><!-- #primary --> <?php endwhile; ?> <?php get_footer();
Save
Cancel