File: /var/www/Application/wp-content/themes/zoomy/index.php
<?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://codex.wordpress.org/Template_Hierarchy
*
* @package zoomy
*/
get_header();
$opt = get_option( 'zoomy_opt' );
$blog_column = is_active_sidebar( 'sidebar_widgets' ) ? '8' : '12';
$blog_layout_opt = ! empty( $opt['blog_layout'] ) ? $opt['blog_layout'] : 'list';
$blog_layout = ! empty( $_GET['blog_layout'] ) ? $_GET['blog_layout'] : $blog_layout_opt;
$blog_column = ! empty ($blog_layout_opt == 'grid') ? '12' : $blog_column;
$is_sticky_header = ! empty( $opt['is_sticky_header'] ) ? $opt['is_sticky_header'] : '';
$is_sticky_class = $is_sticky_header == '1' ? ' pt-90 pb-90 pt-md-80 pb-md-80' : '';
?>
<section class="blog-area blog-main-wrapper">
<div class="blog-bg mt-90 mb-90 <?php echo esc_attr($is_sticky_class); ?>">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="section-title blog-sec-title text-center mb-60 mb-xs-50">
<h2>
<?php Zoomy_helper()->blog_title() ?>
</h2>
</div>
</div>
</div>
<?php
if ( have_posts() ) : ?>
<div class="row">
<?php
if ( $blog_layout == 'list' ) { ?>
<div class="col-lg-<?php echo esc_attr($blog_column); ?> z-blog-content-wrap">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/contents/content', get_post_format() );
endwhile;
?>
<div class="pagination-area text-center mt-20 mb-xl-0 mb-lg-0 mb-70 justify-content-center d-flex">
<?php Zoomy_helper()->pagination(); ?>
</div>
</div>
<?php
get_sidebar();
} else {
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/contents/content-grid' );
endwhile;
?>
<div class="d-flex justify-content-center pagination-area grid-paging text-center">
<?php Zoomy_helper()->pagination(); ?>
</div>
<?php
}
?>
</div>
<?php
wp_reset_postdata();
endif;
?>
</div>
</div>
</section>
<?php
get_footer();