<?php if (get_post_type() !== 'guide') {
    get_template_part('partials/fixed', 'instagram');
} else {
    get_template_part('partials/fixed', 'les_vins_relationel');
}
?>


<!-- FOOTER -->
<footer id="footer" class="footer v2 " role="contentinfo">
    <a href="#" id="backtotop" class="smartphone-size" aria-label="<?php echo esc_attr(__('Retour en haut de page', 'laurentperrier')); ?>">></a>
    <div class="footer-main flex flex-col-reverse md:items-end xl:flex-row xl:items-start xl:justify-between ">
        <div class="text-white  hidden md:block">
            <?php
            $menu = wp_get_nav_menu_object(icl_object_id(4, 'nav_menu', true));
            echo get_field('footer_danger_alcool', $menu);
            ?>
        </div>
        <div class="md:flex md:items-center">
            <nav role="navigation" id="menuFooter" class="mb-3 md:mb-0" aria-label="<?php echo esc_attr(__('Navigation du pied de page', 'laurentperrier')); ?>">
                <?php wp_nav_menu(array('menu' => 'Menu footer')); ?>
            </nav>
            <div class="text-white smartphone-size">
                <?php
                $menu = wp_get_nav_menu_object(icl_object_id(4, 'nav_menu', true));
                echo get_field('footer_danger_alcool', $menu);
                ?>
            </div>
            <div class="lang-select flex" role="navigation" aria-label="<?php echo esc_attr(__('Sélection de langue', 'laurentperrier')); ?>">
                <?php
                $languages = icl_get_languages('skip_missing=0');
                if (1 < count($languages)) {
                    foreach ($languages as $l) {
                        $lang = $l['language_code'];

                        if (!$l['active']) {
                            echo '<a href="' . esc_url($l['url']) . '" class="lang" aria-label="' . esc_attr(sprintf(__('Changer la langue vers %s', 'laurentperrier'), $l['native_name'])) . '">';
                            echo $lang;
                            echo '</a>';
                        }
                    }
                }
                ?>
            </div>
        </div>

    </div>


    <div class="footer-social">
        <?php
        $text_nous_suivre = get_field('footer_nous_suivre', $menu);
        $url_instagram = get_field('footer_instagram', $menu);
        $url_facebook = get_field('footer_facebook', $menu);
        $url_pinterest = get_field('footer_pinterest', $menu);
        $url_youtube = get_field('footer_youtube', $menu);
        $url_linkedin = get_field('footer_linkedin', $menu);
        ?>

        <div class="footer-nous-suivre text-white">
            <?php echo $text_nous_suivre; ?>
        </div>

        <div class="footer-socials">
            <?php if ($url_instagram) { ?>
                <a href="<?php echo esc_url($url_instagram); ?>" target="_blank" class="socials_link instagram" aria-label="<?php echo esc_attr(__('Suivez-nous sur Instagram', 'laurentperrier')); ?>" rel="noopener noreferrer"></a>
            <?php } ?>
            <?php if ($url_facebook) { ?>
                <a href="<?php echo esc_url($url_facebook); ?>" target="_blank" class="socials_link facebook" aria-label="<?php echo esc_attr(__('Suivez-nous sur Facebook', 'laurentperrier')); ?>" rel="noopener noreferrer"></a>
            <?php } ?>
            <?php if ($url_pinterest) { ?>
                <a href="<?php echo esc_url($url_pinterest); ?>" target="_blank" class="socials_link pinterest" aria-label="<?php echo esc_attr(__('Suivez-nous sur Pinterest', 'laurentperrier')); ?>" rel="noopener noreferrer"></a>
            <?php } ?>
            <?php if ($url_youtube) { ?>
                <a href="<?php echo esc_url($url_youtube); ?>" target="_blank" class="socials_link youtube" aria-label="<?php echo esc_attr(__('Suivez-nous sur YouTube', 'laurentperrier')); ?>" rel="noopener noreferrer"></a>
            <?php } ?>
            <?php if ($url_linkedin) { ?>
                <a href="<?php echo esc_url($url_linkedin); ?>" target="_blank" class="socials_link linkedin" aria-label="<?php echo esc_attr(__('Suivez-nous sur LinkedIn', 'laurentperrier')); ?>" rel="noopener noreferrer"></a>
            <?php } ?>
        </div>
    </div>
</footer>


<?php wp_footer(); ?>
<!-- <script type="text/javascript" defer>
    /* Google Tag Manager */
    (function(w, d, s, l, i) {
      w[l] = w[l] || [];
      w[l].push({
        'gtm.start': new Date().getTime(),
        event: 'gtm.js'
      });
      var f = d.getElementsByTagName(s)[0],
        j = d.createElement(s),
        dl = l != 'dataLayer' ? '&l=' + l : '';
      j.async = true;
      j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
      f.parentNode.insertBefore(j, f);
    })(window, document, 'script', 'dataLayer', 'GTM-W3G5CSG');
    /* End Google Tag Manager */
  </script> -->


</body>

</html>