Current File : /home/getxxhzo/tinyrnd.com/wp-content/themes/flyweb/index.php
<?php
/*
 * The Template for displaying all posts
 * 
 */

$blog_default_banner_image = flyweb_get_opt('blog_default_banner_image');
$blog_default_title = flyweb_get_opt('blog_default_title');
$pos_sidebar = flyweb_get_opt( 'widget_sidebar_pos', 'right' );
$home_text = flyweb_get_opt('home_text');

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 if(isset($blog_default_title) && !empty($blog_default_title)){?>
                                        <?php echo html_entity_decode(esc_html($blog_default_title)); ?>
                                    <?php }else{?><?php echo esc_html__( 'Blog', 'flyweb' );}?>
                                </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 if(isset($blog_default_title) && !empty($blog_default_title)){?>
                                        <?php echo wp_specialchars_decode(esc_attr($blog_default_title)); ?>
                                    <?php }else{?><?php echo esc_html__( 'Blog', 'flyweb' );}?>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
</section>

<!-- BLOG LIST
================================================== -->
<section class="page-section">
    <div class="container">
        <div <?php flyweb_primary_class( $pos_sidebar ); ?>>

            <?php if ( is_active_sidebar( 'sidebar-1' ) ){?>
                <div class="col-lg-8 mb-5 mb-lg-0 mt-n2-9">
            <?php }else{ ?>
                <div class="col-lg-12 mt-n2-9">

                    <?php } ?>
                        <?php  $args = array(    
                            'paged' => $paged,
                            'post_type' => 'post',
                        );
                        
                        $i =0;
                        $wp_query = new WP_Query($args);
                        while (have_posts()): the_post(); 
                        $i=$i+100; ?>    

                        <div <?php post_class(); ?>>

                            <article class="card card-style04 mt-2-9 h-auto wow fadeInUp" data-wow-delay="<?php echo html_entity_decode ( esc_html($i) ); ?>ms">
                                <?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="mb-3"><a href="<?php the_permalink();?>"><?php if(is_sticky()) { ?><i class="fas fa-thumbtack me-3"></i><?php } ?><?php the_title();?></a></h3>
                                    <p class="mb-0"><?php echo esc_attr(flyweb_excerpt()); ?></p>
                                </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 fadeIn" 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>

            <?php if ( 'left' == $pos_sidebar && is_active_sidebar( 'sidebar-1' ) || 'right' == $pos_sidebar && is_active_sidebar( 'sidebar-1' ) ) : ?>
                <div class="col-lg-4">
                    <div <?php flyweb_secondary_class( $pos_sidebar ); ?>>
                        <?php get_sidebar(); ?>
                    </div>
                </div>
            <?php endif; ?>
            
        </div>
    </div>
</section>
    

<?php
    get_footer();
?>