🏠 Root
/
home
/
artorgp
/
www
/
wp-content
/
themes
/
olorun
/
Editing: taxonomy-country.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(); $queried_object = get_queried_object(); $current_country_id = $queried_object->term_id; $country = get_term( $current_country_id, 'country' ); $current_country = $country->name; $current_country_slug = $country->slug; ?> <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/countries/"> <span itemprop="name">Pays</span> <meta itemprop="position" content="2"> </a> </li> </ol> <h1><?php echo $current_country; ?></h1> <button onclick="showMap()" id="button-show">Masquer la carte.</button> <?php /*<section class="grid align-center"> <aside> <p><?php echo $count_artists; ?> Artistes</p> </aside> <aside> <p><?php echo $query_curators->post_count; ?>Commissaires d'exposition</p> </aside> <aside> <p>Lieux</p> </aside> <aside> <p>Evénements</p> </aside> </section> */ ?> <?php $query_places = array( 'post_type' => 'place', 'tax_query' => array( array( 'taxonomy' => 'country', 'field' => 'slug', 'terms' => $current_country_slug, ) ), 'meta_query' => array( array( 'key' => 'place_map', 'compare' => 'EXISTS', ) ), '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($id), 'url' => get_permalink($id), ); $i++; } } ?> <div class="acf-map" id="country-map" style="display:block;" data-zoom="18"> <?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_query(); ?> <?php $query_artists = array( 'post_type' => 'person', 'tax_query' => array( array( 'taxonomy' => 'country', 'field' => 'slug', 'terms' => $current_country_slug, ) ), 'posts_per_page'=> 10, 'orderby' => 'date', 'order' => 'DESC', ); ?> <section id="last-elements" style="display:block;"> <?php $query_artists = new WP_Query($query_artists); $count_artists = $query_artists->found_posts; if($query_artists->have_posts()): echo '<h2>'. $count_artists . ' Artistes et commissaires d\'exposition originaires du pays '.$current_country.'</h2>'; 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_query(); ?> </section> </main><!-- #main --> </div><!-- #primary --> <?php get_footer();
Save
Cancel