<?php get_header(); ?>
<div class="container py-5">
    <div class="row">
        <div class="col-12">
            <?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>
        </div>
    </div>
</div>
<div class="container single_header">
    <div class="row">
        <div class="col-12">
            <?php

            if(get_field(' single_header_img')) {
                $header_img = get_field(' single_header_img');
                $header_img_url = $header_img['sizes']['c_slider'];
            }else{
                $thumb_id = get_post_thumbnail_id();
                $thumb_url = wp_get_attachment_image_src($thumb_id, 'c_slider', true);
                $header_img_url = $thumb_url[0];
            }
                echo '<img alt="'.get_the_title().'" src="'.$header_img_url.'" class="img-fluid">';

            $title = get_the_title();
            if(get_field('single_header_title')){
                $title = get_field('single_header_title');
            }
            ?>
        </div>
        <div class="col-12 col-lg-8 offset-lg-2">
            <div class="single_header_bloc bg-beige">
                <h1 class="white h3"><?php echo $title;?></h1>
                <div class="social">
                    <p class="brown text-center">Partager cet article</p>
                <ul class="list-inline social_share">
                    <li class="list-inline-item">
                        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo get_permalink();?>" target="_blank">
                            <i class="bi bi-facebook brown"></i>
                        </a>
                    </li>
                    <li class="list-inline-item">
                        <a href="https://www.linkedin.com/sharing/share-offsite/?url=<?php echo get_permalink();?>" target="_blank">
                            <i class="bi bi-linkedin brown"></i>
                        </a>
                    </li>
                    <li class="list-inline-item">
                        <a href="https://twitter.com/intent/tweet?url=<?php echo get_permalink();?>" target="_blank">
                            <i class="bi bi-twitter brown"></i>
                        </a>
                    </li>
                </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12 p-5 col-lg-10 offset-lg-1 post_content">
        <?php the_content();?>
        </div>
    </div>
</div>


<div class="container-fluid news_part bg-white">
    <div class="container">
        <div class="row">
            <div class="col-12 mt-5">
                <p class="suptitle suptitle_arrow">L'actualité</p>
            </div>
        </div>
        <div class="row">
            <div class="col-12 col-md-9">
                <h2 class="h2 brown news_part_title">Découvrir nos autres <strong>actualités</strong></h2>
            </div>
            <div class="col-12 col-md-3">
                <p class="text-end archive_link">
                    <a href="<?php echo get_post_type_archive_link('actualite');?>" class="text-uppercase brown">Tout Découvrir</a>
                </p>
            </div>
        </div>
    </div>
    <?php
    $temp = 'new';
    include 'inc/slider-news.php';
    ?>
</div>




<?php get_footer(); ?>
