%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/cwg/wp-content/themes/cwg/
Upload File :
Create Path :
Current File : //var/www/cwg/wp-content/themes/cwg/single-pressarticles.php

<?php

get_header();

?>

<?php
while (have_posts()) :
    the_post();
?>
    <div class="pl-5 md:pl-14 font-medium md:block uppercase mt-[80px]">
    </div>

    <div class="px-5 md:px-14 mb-6 md:mb-[30px] md:mt-[6px] ariane-press">
        <?php the_breadcrumbs(); ?>
    </div>


    <?php
        $images_gallery = get_field('carrousel_press');

        $categories = get_the_terms($post->ID, 'press-publication');
                        if ($categories) {
                            foreach ($categories as $category) {
                                $cat_image = get_field('image', 'press-publication_' . $category->term_id);
                            }
                        }
    ?>

    <div class="press-details-content-container">
        <div class="left">
            <div class="js-press-carrousel artist-carrousel press-carrousel w-full">
                <?php if($images_gallery): ?>
                    <?php foreach( $images_gallery as $gallery ): ?>
                        <div>
                            <?= wp_get_attachment_image($gallery['id'], 'full', false, array('class' => 'img-press-carrousel')); ?>
                            <?php 
                                if (!empty($cat_image)) {
                                    echo wp_get_attachment_image($cat_image['id'], 'full', false, array('class' => 'w-auto img-logo-press mb-[5px] object-cover'));
                                }
                            ?>
                        </div>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div> 
        </div>
        <div class="right">
            <div class="article-info-top">
                <h1 class="title"><?= get_the_title() ?></h1>

                <div class="by-date">
                    <?php if ($categories) : ?>
                        By
                        <?= $categories[0]->name; ?> 
                        -
                    <?php endif ?>    
                    <?= get_the_date(); ?>
                    </div>
            </div>
            <div class="the-content">
                <?= get_the_content(); ?>

            </div>

            <!-- DESKTOP --> 
            <div class="readmore-share">
            
                <?php $link_article = get_field('read_full_article') ?>

                <?php if($link_article) :?>
                    <a class="read-article" href="<?php echo esc_url( $link_article );?>" target="_blank" rel="noopener noreferrer nofollow">Read full article</a>
                <?php endif ?>

                <div class="share-post-btn share-negative ml-15">
                    <?php echo do_shortcode('[addthis tool="addthis_inline_share_toolbox_qfxd"]'); ?>
                </div>

                <?php $link_more = get_field('link_more_detail') ?>
            <?php if($link_more) :
                $link_more_url = $link_more['url'];
                $link_more_title = $link_more['title'];
                $link_more_target = $link_more['target'] ? $link_more['target'] : '_self';?>
                <a class="btn-stroked mb-7 whitespace-nowrap mt-8 w-[160px] font-thin uppercase" href="<?php echo esc_url( $link_more_url );?>" target="<?php echo esc_attr( $link_more_target ); ?>"><?php echo esc_html( $link_more_title ); ?></a>
             <?php endif ?>

            </div>    
        </div>
    </div>

    <!-- MOBILE -->

    <div class="w-full flex items-end px-5 md:hidden mb-7">
        <div class="flex flex-col">
        <i class="text-[12px] h-[15px] font-thin text-grey-textLight mb-2">
            <?php if ($categories) : ?>
                By
                <?= $categories[0]->name; ?> 
                -
            <?php endif ?>    
            <?= get_the_date(); ?>
        </i>
        <?php $link_article = get_field('read_full_article') ?>
        <?php if($link_article) :?>
            <a class="text-xs font-thin underline-carpenters underline-carpenters-press pr-1 cursor-pointer" href="<?php echo esc_url( $link_article );?>">> Read the full article</a>
        <?php endif ?>
        </div>    
        <div class="ml-auto">
           <div class="share-post-btn share-negative ml-15">
                <?php echo do_shortcode('[addthis tool="addthis_inline_share_toolbox_qfxd"]'); ?>
            </div>
        </div>
    </div>

    <!---->

    <?php $link_more = get_field('link_more_detail') ?>
    <?php if($link_more) :
        $link_more_title = $link_more['title'];?>
        <div class="w-full flex md:hidden">
            <a class="btn-stroked w-full mb-7 whitespace-nowrap mx-5 md:mx-14 font-thin uppercase" href="<?php echo esc_url( $link_more );?>"><?php echo esc_html( $link_more_title ); ?></a>
        </div>    
    <?php endif ?>

    <section class="w-full cwg-container-main mb-7">
            <div class="w-full flex items-center justify-between mb-[13px] md:mb-[30px]">
                <h2 class="text-[13px] md:text-[15px] font-normal uppercase">More Press</h2>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-3 gap-[30px] js-press-container">
                <?php

                    $args = array(
                        'order' => 'DESC',
                        'post_type' => 'pressarticles',
                        'post_status' => 'publish',
                        'post__not_in' => array(get_the_id()),
                        'posts_per_page' => 3
                    );
                    $postslist = get_posts($args);
                    foreach ($postslist 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">
                    <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-contain'));
                                }?>
                                <h2 class="uppercase text-[13px] font-light leading-4 text-white"><?php shorten_text(get_the_title(), 65) ?></h2>
                            </div>
                        </div>
                    </a>
                    <div class="pt-3 pb-5">
                        <a href="<?php the_permalink(); ?>">
                            <div class="text-[12px] font-light mb-2 lg:hidden"><?php shorten_text(strip_tags(get_the_content()), 120)?> </div>
                            <div class="hidden lg:flex text-[12px] font-light mb-2 lg:h-[54px]"><?php shorten_text(strip_tags(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-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
endwhile;
?>

<?php

get_footer();

?>    

Zerion Mini Shell 1.0