Current File : /home/getxxhzo/tinyrnd.com/wp-content/themes/flyweb/page-templates/blog-grid-2-columns.php
<?php
/*
 * Template Name: Blog Two Columns
 * Description: A Page Template with a Page Builder design.
 */

$blog_default_banner_image = flyweb_get_opt('blog_default_banner_image');
$home_text = flyweb_get_opt('home_text');
$grid_number = flyweb_get_opt('grid_number');
get_header(); 

?>

<!-- PAGE TITLE
================================================== -->
<?php if(isset ($blog_default_banner_image['url']) && !empty ($blog_default_banner_image['url']) ){?>
<section class="page-title-section bg-img cover-background left-overlay-secondary" data-overlay-dark="6" data-background="<?php printf ( esc_url($blog_default_banner_image['url'])); ?>">
    <?php }else{?>
        <section class="page-title-section bg-img cover-background secondary-overlay" data-overlay-dark="95">
            <?php }?>
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
                        <div class="text-start">
                            <div class="position-relative">
                                <h1><?php the_title();?></h1>
                            </div>
                            <ul>
                                <li><a href="<?php echo esc_url(home_url('/')); ?>">
                                    <?php if(isset($home_text) && !empty($home_text)){?>
                                        <?php echo wp_specialchars_decode(esc_attr($home_text)); ?>
                                    <?php }else{?>
                                        <?php echo esc_html__( 'Home', 'flyweb' );
                                    }?>
                                </a></li>
                                <li><?php the_title(); ?></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
</section>

<!-- BLOG GRID
================================================== -->
<section class="page-section">
    <div class="container">
        <div class="row gx-xl-5 mt-n2-2">

            <?php  $args = array(    
                'paged' => $paged,
                'post_type' => 'post',
                'posts_per_page' => $grid_number,
            );

            $i =0;
            $wp_query = new WP_Query($args);
            
            while (have_posts()): the_post();

            $i=$i+100; ?>

            <div class="col-md-6 mt-2-2 wow fadeInUp" data-wow-delay="<?php echo html_entity_decode ( esc_html($i) ); ?>ms">
                <article class="card card-style04 h-100">
                    <?php if (get_post_thumbnail_id() !='')  { ?>
                        <div class="blog-img position-relative overflow-hidden image-hover">
                            <img src="<?php echo wp_get_attachment_url(get_post_thumbnail_id());?>" alt="<?php the_title_attribute(); ?>" class="rounded-top">
                            <div class="card-list"><?php echo get_the_tag_list(); ?></div>
                        </div>
                    <?php } ?>
                    <div class="card-body p-1-6 p-sm-1-9">
                        <span class="text-primary d-block mb-2 font-weight-600"><?php the_time(get_option( 'date_format' ));?></span>
                        <h3 class="h4 mb-0"><a href="<?php the_permalink();?>"><?php the_title();?></a></h3>
                    </div>
                    <div class="d-flex fw-bold border-top px-1-6 px-sm-1-9 py-3 border-color-light-black justify-content-between">
                        <a href="<?php the_permalink();?>">Read more</a>
                        <a href="<?php the_permalink();?>"><i class="ti-arrow-right"></i></a>
                    </div>
                </article>
            </div>

            <?php endwhile; ?>

            <!-- start pager  -->
            <div class="wow fadeInUp" data-wow-delay="200ms">
                <?php 
                  $pagination = array(
                      'base'      => str_replace( 999999999, '%#%', get_pagenum_link( 999999999 ) ),
                      'format'    => '',
                      'prev_text' => wp_specialchars_decode(esc_html__( '<i class = "fa fa-angle-left"></i>', 'flyweb' ),ENT_QUOTES),
                      'next_text' => wp_specialchars_decode(esc_html__( '<i class = "fa fa-angle-right"></i>', 'flyweb' ),ENT_QUOTES),
                      'type'      => 'list',
                      'end_size'    => 3,
                      'mid_size'    => 3
                    );
                  if(paginate_links( $pagination )!= ''){
                    $return =  paginate_links( $pagination );
                    echo str_replace( "<ul class='page-numbers'>", '<ul class="pagination justify-content-center d-block text-center mt-2-9 ms-0 mb-0">', $return );
                    }
                ?>
            </div>
            <!-- end pager -->

        </div>
    </div>
</section>

<!-- end blog section -->
<?php
    get_footer();
?>