
<!-- page-pagination-section 
    ================================================== -->
<section class="page-title">
    <div class="container">
        <?php 
            $title = get_theme_mod( 'blog_title','Blog');
            $subtitle = get_theme_mod( 'sub_title', esc_html__('News and stories from the team at TripTip','triptip'));
        ?>
        <?php if(is_category()){ ?>
            <h1 class="page-title__title"><?php single_cat_title( '', true ); ?></h1>

        <?php }elseif(is_archive()){ ?>
            <h1 class="page-title__title"><?php the_archive_title(); ?></h1>
        <?php }elseif(is_404()){ ?>
            <h1 class="page-title__title"><?php esc_html_e('404 Error','triptip'); ?></h1>
        <?php }elseif (is_tag()) { ?>
            <h1 class="page-title__title"><?php single_tag_title();?></h1>
        <?php }elseif (is_search()) { ?>
            <h1 class="page-title__title"><?php esc_html_e('Search results for','triptip'); ?>: '<?php echo esc_attr( get_search_query() ); ?>'</h1>
        <?php }else{ ?>
            <h1 class="page-title__title"><?php echo esc_html($title);?></h1>
        <?php } ?>
        <?php if($subtitle!=''){ ?>
            <span class="page-title__description"><?php echo esc_html($subtitle); ?></span>
        <?php } ?>
    </div>
</section>
<!-- End page-pagination section -->


<!-- blog-page-section 
    ================================================== -->
<section class="blog-page">
    <div class="container">
        <div class="blog-page-box">
        <div class="row">
            <?php if(is_active_sidebar('sidebar-1')){ ?>
            <div class="col-md-8">
            <?php }else{ ?>
            <div class="col-md-12">
            <?php } ?>
            <div class="blog-page__box">
                <div class="news-box iso-call blog<?php if(!is_active_sidebar('sidebar-1')){ ?> no-sidebar<?php } ?>">
                    <?php 
                        $i=1; if(have_posts()) :
                            while(have_posts()) : the_post(); 
                    ?>
                        <div class="col-md-6 col-sm-6">
                            
                            <!-- news-post module -->
                            <div <?php post_class('news-post'); ?>>
                                <?php if(has_post_thumbnail()){ ?>
                                    <div class="news-post__gal">
                                        <?php the_post_thumbnail(''); ?>
                                        <span class="news-post__date">
                                            <?php the_time(get_option( 'date_format' )); ?>
                                        </span>
                                    </div>
                                <?php } ?>
                                <div class="news-post__content">
                                    <h2 class="news-post__title">
                                        <a href="<?php the_permalink(); ?>"><?php if(is_sticky()){ ?><i class="fa fa-flash"></i> <?php } ?> <?php the_title(); ?></a>
                                    </h2>
                                    <?php if(has_category()){ ?>
                                        <ul class="news-post__tags">
                                            <li><?php the_category(', ');?></li>
                                        </ul>
                                    <?php } ?>
                                    <p class="news-post__description">
                                        <?php echo triptip_excerpt($limit = 30); ?>
                                    </p>
                                    <a class="text-btn" href="<?php the_permalink(); ?>">
                                        <?php esc_html_e('Read More', 'triptip'); ?> <i class="la la-long-arrow-right"></i>
                                    </a>
                                </div>
                            </div>
                            <!-- end news-post module -->
                        </div>
                    <?php $i++; endwhile; ?>
                            
                    <?php else: ?>
                        <div class="blog-post not-found">
                                <h2 class="heading2"><?php esc_html_e('Nothing Found Here!','triptip'); ?></h2>
                                <p ><?php esc_html_e('Search with other keyword:', 'triptip') ?></p>
                                
                                 <?php get_search_form(); ?>
                                
                        </div>
                    <?php endif; ?>

                </div>
                <?php triptip_pagination($prev = '<i class="la la-long-arrow-left"></i> ', $next = ' <i class="la la-long-arrow-right"></i>', $pages=''); ?>
            </div>
        </div>

            <div class="col-md-4">
                <?php get_sidebar(); ?>
            </div>

        </div>
    </div>
    </div>
</section>
<!-- End news section -->
