%PDF- %PDF-
Direktori : /var/www/cwg/wp-content/themes/cwg/ |
Current File : //var/www/cwg/wp-content/themes/cwg/single-artists.php |
<?php get_header(); ?> <!----Should be placed when there is no carousel--> <div class="js-headerGap h-[51px]"></div> <?php while (have_posts()) : the_post(); ?> <h2 class="px-14 font-medium hidden md:block uppercase mt-[30px]"> Artists </h2> <div class="px-5 md:px-14 my-6 md:mb-[30px] md:mt-[6px]"> <?php the_breadcrumbs(); ?> </div> <div class="flex flex-col md:flex-row px-5 md:px-14 md:mb-[60px]"> <div class="w-full md:w-3/5 mb-6 md:mb-0"> <div class="js-artist-carrousel hidden md:block exhib-carrousel carrousel-height w-full"> <?php ob_start(); ?> <?php if (have_rows('carrousel')) : ?> <?php while (have_rows('carrousel')) : the_row(); ?> <?php if (get_row_layout() == 'video') : ?> <div class="vimeo-video js-video"><?= preg_replace('/src="(.+?)"/', 'src="$1?enablejsapi=1"', get_sub_field('video')) ?></div> <?php endif; ?> <?php if (get_row_layout() == 'image') : ?> <?php $image = get_sub_field('image') ?> <?= wp_get_attachment_image($image['id'], 'full', false, array('class' => 'object-cover w-auto')); ?> <?php endif; ?> <?php endwhile; ?> <?php endif; ?> <?php $carrousel_content = ob_get_clean() ?> <?= $carrousel_content ?> </div> <div class="js-artist-carrousel-mobile md:hidden exhib-carrousel carrousel-height w-full"> <?= $carrousel_content ?> </div> </div> <div class="flex flex-col w-full md:w-auto md:pl-10 md:max-h-[460px] md:overflow-y-auto scrollbar-thin md:pr-4"> <div class="flex flex-row"> <h1 class="text-[13px] md:text-[15px] uppercase"><?= get_the_title() ?></h1> <div class="ml-auto hidden md:block"> <div class="flex-row flex cursor-pointer" onclick="copyToClipboard(<?php get_permalink(get_the_ID()); ?>)"> <span class="mr-1"><?php include(locate_template('/assets/img/share-black.svg')); ?> </span> <div class="flex text-xs uppercase font-thin items-center">Share</div> </div> </div> </div> <div class="text-xs font-light pt-2 md:pt-[14px] mb-[18px] gap-3 grid grid-cols-1"> <?= get_field('description'); ?> <div id="more" class="hidden gap-3 md:grid grid grid-cols-1"> <?= get_field('show_more_description'); ?> </div> </div> <?php if(get_field('informations_doc')): ?> <div class="w-full mb-4 lg:mb-0"> <a href="<?= get_field('informations_doc') ?>" rel="noopener noreferrer nofollow" class="btn-stroked w-full max-w-[200px] font-thin"> <?php include(locate_template('/assets/img/icon-file-download.svg')); ?> <span class="ml-3">MORE INFORMATIONS</span> </a> </div> <?php endif; ?> </div> </div> <div class="w-full flex px-5 md:hidden mb-10"> <?php if (get_field('show_more_description') !== '') : ?> <a class="text-xs font-thin underline-carpenters pr-1 cursor-pointer md:hidden" onclick="showMore()" id="link-show">> More</a> <?php endif; ?> <div class="ml-auto"> <div class="flex flex-row cursor-pointer js-shareBtn" data-title="Check out this artist on CWG" data-text="<?= get_the_title(); ?>" data-link="<?= get_permalink(get_the_ID()); ?>"> <span class="mr-1"><?php include(locate_template('/assets/img/share-black.svg')); ?> </span> <div class="flex text-xs uppercase font-thin items-center">SHARE</div> </div> </div> </div> <?php $custom_placment = get_field('artist_works'); $nb_custom_placement = is_array($custom_placment) ? count($custom_placment) : 0; $args = array( 'posts_per_page' => 10 - $nb_custom_placement, 'post_type' => 'product', 'product_cat' => 'Work', 'post__not_in' => $custom_placment, 'order' => 'DESC', 'post_status' => 'publish', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'artist_override', 'value' => get_the_id(), 'compare' => 'LIKE', ) ), ); $wc_query = new WP_Query($args); ?> <?php if ($wc_query->have_posts() || $nb_custom_placement > 0) : ?> <section class="w-full mb-10 md:mb-[60px] px-5 md:px-14"> <div class="w-full flex items-center justify-between mb-[13px] md:mb-[30px]"> <h2 class="text-[13px] md:text-[15px] font-normal uppercase">Selection of Works</h2> <div class="flex flex-row"> <div class="flex text-xs uppercase font-thin items-center"> <a href="<?php echo get_permalink(257580) . '?artist[]=' . get_the_id() ?>" class="btn-stroked btn-view-all-artist w-[100px] md:w-[160px] whitespace-nowrap px-8 py-3 font-thin uppercase">View all</a> </div> </div> </div> <div class="w-full grid grid-cols-2 gap-[13px] grid-rows-2 md:gap-[30px] md:grid-cols-4 show-mobile-5 artist-collectibles"> <?php if ($nb_custom_placement > 0) { foreach ($custom_placment as $prod) { $product_post = new WP_Query(['p' => $prod, 'post_type' => 'product', 'post_status' => 'publish']); if ($product_post->have_posts()) { $product_post->the_post(); $product = wc_get_product($prod); $price = $product->get_price(); $artist = get_field('multiple_artist_title') ? get_field('multiple_artist_title') : get_field('artist_override'); include(locate_template('template-parts/products/collectible-item.php')); } } wp_reset_postdata(); } while ($wc_query->have_posts()) { $wc_query->the_post(); $product = wc_get_product(get_the_ID()); $price = $product->get_price(); $artist = get_field('multiple_artist_title') ? get_field('multiple_artist_title') : get_field('artist_override'); include(locate_template('template-parts/products/collectible-item.php')); } wp_reset_postdata(); ?> </div> </section> <?php endif; ?> <?php artist_tuile('Jewellery', 'Selection of Jewellery', get_field('artist_jewellery')); artist_tuile('Shop', 'In The Workshop Shop', get_field('artist_wss')); ?> <!-- ROW EXHIBITION --> <?php $args = array( 'order' => 'DESC', 'post_type' => 'exhibitions', 'posts_per_page' => 4, 'post_status' => 'publish', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'artist', 'value' => get_the_id(), 'compare' => 'LIKE', ) ) ); $postslist = get_posts($args); $image_background = get_field('square_listing_image'); $wc_query = new WP_Query($args); ?> <?php if ($wc_query->have_posts() > 0) : ?> <section class="w-full mb-10 md:mb-[60px] px-5 md:px-14"> <div class="w-full flex items-center justify-between mb-[13px] md:mb-[30px]"> <h2 class="hidden md:flex md:text-[15px] md:font-normal md:uppercase">Last Exhibitions</h2> <h2 class="text-[13px] font-normal uppercase md:hidden">Last Exhibition</h2> <div class="flex flex-row"> <div class="flex text-xs uppercase font-thin items-center"> <a href="<?php echo get_permalink(191727) . '?artist=' . get_the_id() ?>" class="btn-stroked btn-view-all-artist w-[100px] md:w-[160px] whitespace-nowrap px-8 py-3 font-thin uppercase">View all</a> </div> </div> </div> <div class="grid grid-cols-1 md:grid-cols-4 w-full gap-6 grid-exhibition-artist"> <?php foreach ($postslist as $event) : ?> <?php include(locate_template('template-parts/events/event-item.php')); ?> <?php endforeach; ?> </div> </section> <?php endif ?> <!-- ROW press --> <?php $args = array( 'numberposts' => 3, 'order' => 'DESC', 'post_type' => 'pressarticles', 'post_status' => 'publish', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'artist_press', 'value' => get_the_id(), 'compare' => 'LIKE', ) ) ); $wc_query = new WP_Query($args); ?> <?php if ($wc_query->have_posts() > 0) : ?> <section class="w-full cwg-container-main mb-[60px]"> <div class="w-full flex items-center justify-between mb-[13px] md:mb-[30px]"> <h2 class="text-[13px] md:text-[15px] font-normal uppercase">Press</h2> <a href="<?= get_permalink(4886) . '?artist=' . get_the_id() ?>" class="btn-stroked btn-view-all-artist w-[100px] md:w-[160px] whitespace-nowrap px-8 py-3 font-thin uppercase"> VIEW ALL </a> </div> <div class="grid grid-cols-1 md:grid-cols-3 w-full gap-[30px] grid-press-artist"> <?php foreach ($wc_query->posts as $post) : setup_postdata($post); $categories = get_the_terms($post->ID, 'press-publication'); if ($categories) { foreach ($categories as $category) { $cat_image = get_field('image', 'press-publication_' . $category->term_id); } } $image_background = get_field('thumbnail'); ?> <div class="w-full press-artist-element"> <a href="<?php the_permalink(); ?>"> <div class="w-full h-[196px] relative"> <?= wp_get_attachment_image($image_background['id'], 'full', false, array('class' => 'w-full h-[196px] object-cover img-press-brightness')); ?> <div class="absolute left-[12px] bottom-[10px] w-[70%] "> <?php if (!empty($cat_image)) { echo wp_get_attachment_image($cat_image['id'], 'full', false, array('class' => 'w-auto h-3 mb-2 object-cover')); } ?> <h3 class="uppercase text-[13px] font-light leading-4 text-white"><?php shorten_text(get_the_title(), 65) ?></h3> </div> </div> </a> <div class="pt-3 pb-4"> <a href="<?php the_permalink(); ?>"> <div class="text-[12px] font-light mb-[5px] lg:h-[72px]"><?php shorten_text(get_the_content(), 180); ?> </div> </a> <div class="flex justify-between"> <i class="text-[12px] h-[15px] font-thin text-grey-textLight"> <?php if ($categories) : ?> By <?= $categories[0]->name; ?> - <?php endif ?> <?= get_the_date() ?> </i> <div class="js-shareBtn flex justify-between items-center text-[12px] w-[58px] h-[15px] leading-5 text-grey-dark uppercase" data-title="Check out this article" data-text="<?= get_the_title(); ?>" data-link="<?= get_permalink(get_the_ID()); ?>"> <span><?php include(locate_template('/assets/img/share-black.svg')); ?></span> SHARE </div> </div> </div> </div> <?php endforeach; ?> </div> </section> <?php endif ?> <?php endwhile; ?> <?php get_footer(); ?>