%PDF- %PDF-
Direktori : /var/www/cwg/wp-content/themes/cwg/ |
Current File : //var/www/cwg/wp-content/themes/cwg/dna.php |
<?php /** * The main template file * Template Name: DNA * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package onepoint */ global $post; get_header(); if(have_posts()) { while (have_posts()) { the_post(); if (have_rows('dna')) { while (have_rows('dna')) { the_row(); ?> <section class="relative h-screen w-full mb-[110px] lg:mb-0"> <?php $row_image_mobile = get_sub_field('image_mobile'); ?> <?php $row_image_desktop = get_sub_field('image_desktop'); ?> <?= wp_get_attachment_image($row_image_mobile['id'], 'full', false, array('class' => 'h-screen w-full object-cover lg:hidden')); ?> <?= wp_get_attachment_image($row_image_desktop['id'], 'full', false, array('class' => 'h-screen w-full object-cover hidden lg:block')); ?> <div class="absolute w-[calc(100%-40px)] lg:w-[440px] mx-5 bottom-[-50px] bg-white pt-[22px] pb-[12px] px-[24px] lg:pt-[36px] lg:pb-[30px] lg:px-[30px] lg:right-[60px] lg:bottom-[60px] lg:m-0"> <h2 class="text-base font-medium h-[24px] uppercase mb-2.5"><?php the_sub_field('title'); ?></h2> <div class="text-xs font-light"><?php the_sub_field('description'); ?></div> <?php if(get_sub_field('link_button') != '' && get_sub_field('label_button') != '') { ?> <a class="w-[130px] h-[40px] mt-2.5 flex items-center justify-center text-[12px] font-light text-center border border-grey-medium uppercase" href="<?php the_sub_field('link_button'); ?>"><?php the_sub_field('label_button'); ?></a> <?php } ?> </div> </section> <?php } } else { ?> <!----Should be placed when there is no carousel--> <div class="js-headerGap"></div> <?php } if (have_rows('history')) { ?> <section class="relative w-full px-[20px] pt-[60px] pb-0 lg:px-[165px] lg:py-[65px]"> <h3 class="text-base leading-6 font-medium uppercase mb-[15px]">History</h3> <?php while (have_rows('history')) { the_row(); ?> <h4 class="text-sm leading-6 uppercase mb-[15px]"><?php the_sub_field('title'); ?></h4> <div class="relative w-full mb-[40px] pl-5 lg:px-[30px] border-l border-black"> <?php if(count(get_sub_field('gallery'))>0) { ?> <div class="flex flex-col flex-wrap items-stretch lg:flex-row mb-5 gap-x-[50px] gap-y-3 "> <?php $count = 0; foreach(get_sub_field('gallery') as $gal) { $row_image = $gal['image']; $description = $gal['description']; $count++; ?> <div class="flex flex-col w-auto" style="<?= "flex:". (count(get_sub_field('gallery'))>1?$row_image['width']/$row_image['height'] ."":"1") ?>"> <?= wp_get_attachment_image($row_image['id'], 'full', false, array('class' => 'w-auto h-full object-cover')); ?> <div class="mt-[15px] text-[10px] font-light text-[#999999]"><?php echo $description; ?></div> </div> <?php if($count>=4) { ?> <div style="flex-basis: 100%;height: 0;"></div> <?php $count = 0; } } ?> </div> <?php } ?> <div class="text-xs font-light"><?php the_sub_field('description'); ?></div> </div> <?php } ?> </section> <?php } } } ?> <?php get_footer(); ?>