%PDF- %PDF-
Direktori : /var/www/cwg/wp-content/themes/cwg/ |
Current File : //var/www/cwg/wp-content/themes/cwg/whats-on-live.php |
<?php /** * The main template file * Template Name: What's on live * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package onepoint */ global $post; get_header(); $date = date('Ymd'); $args = array( 'post_status' => 'publish', 'post_type' => ['exhibitions', 'fairs', 'popups'], 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'start_date', 'value' => $date, 'compare' => '<' ), array( 'key' => 'end_date', 'value' => $date, 'compare' => '>' ) ), 'orderby' => 'start_date', 'order' => 'DESC' ); $query = new WP_Query($args); ?> <section class="relative h-screen w-full bg-[#040f25] overflow-hidden"> <div class="earth-container" data-lat="10" data-lng="2" data-land="#d0e7ec" data-sea="#12233e"> <div class="glow"></div> </div> <div class="swiper-nav"> <div class="swiper-button-prev-cust" role="button" aria-label="Previous slide"><?php include(locate_template('/assets/img/icon-white-navigation-prev.svg')) ?></div> <div class="swiper-button-next-cust" role="button" aria-label="Next slide"><?php include(locate_template('/assets/img/icon-white-navigation-next.svg')) ?></div> </div> <div class="swiper-container mySwiper"> <div class="swiper-wrapper ml-[10px] lg:ml-[100px]"> <?php if(!empty($query) && !empty($query->posts)) { foreach($query->posts as $queryPost) { $id = $queryPost->ID; $postType = $queryPost->post_type; $subTitle = $queryPost->post_type == 'exhibitions' ? $queryPost->post_title : get_field('booth', $queryPost->ID); $lat = get_field('lat', $id); $lng = get_field('lng', $id); $artists = get_field('artist', $id); $title = $queryPost->post_title; if($queryPost->post_type == 'exhibitions') { $title = get_field('multiple_artist_title', $id) ? get_field('multiple_artist_title', $id) : ($artists[0]->post_title ?? ''); } $isHome = get_field('is_home', $id); $img = wp_get_attachment_image(get_field('square_listing_image', $id)); $link = get_permalink($id); $city = get_the_terms($id, get_taxonomy_name($queryPost->post_type))[0]->name ?? ''; if($lat != null && $lng != null) { ?> <div class="swiper-slide" data-lat="<?= $lat; ?>" data-lng="<?= $lng; ?>"> <div class="swiper-info"> <h2 class="swiper-title"> <span class="swiper-oval swiper-<?= $postType; ?>"></span><?= substr($postType, 0, -1); ?> </h2> <div class="swiper-content"> <h3 class="swiper-artist"><?= $title; ?></h3> <p class="swiper-collection"><?= $subTitle; ?></p> </div> <p class="swiper-position"><?php $isHome ? include(locate_template('/assets/img/icon-grey-home.svg')) : '' ?><?= $city; ?></p> </div> <div class="swiper-image"><?= $img; ?></div> <a href="<?= $link; ?>" class="swiper-link"><?php include(locate_template('/assets/img/icon-black-navigation-next.svg')) ?></a> </div> <?php } } } ?> </div> </div> </section> <?php get_footer(); ?>