<div class="page-title">
    <div class="container">
        <div class="banner-full-wrap">
            <div class="row g-0">
                <div class="col-md-4">
                    <div class="text-center banner-right-wrap">
                        <h1 class="main-title">Articles</h1>
                    </div>
                </div>
                <div class="col-md-8">
                    <img src="<?php echo base_url(); ?>assets/user/img/Articles-useful.webp" alt="shop" class="w-100">
                </div>
            </div>
        </div>
    </div>
</div>


<div class="home2 news-section">
    <div class="container">
        <div class="row g-3">
            <div class="col-lg-12 col-md-12 col-sm-12 col-12 mb-md-5 mb-4">
                <div class="home2-inner">
                    <h4 class="main-title mb-md-0">Discover The Latest News</h4>
                </div>
            </div>
        </div>
        <div class="row gx-md-4 gy-md-5 g-3">
            <?php if(isset($blog) && $blog){ foreach ($blog as $key => $value){ ?>
                <div class="col-lg-4 col-md-4 col-sm-4 col-12">
                    <div class="our-news">
                        <div class="img-wrap">
                            <?php if($value['image']!=''){ ?>
                                <img src="<?php echo base_url($value['image']); ?>" class="img-fluid" alt="recipe image">
                            <?php }else{ ?>
                                <img src="<?php echo base_url(); ?>assets/user/img/news.webp" class="img-fluid" alt="recipe image">
                            <?php } ?>
                        </div>
                        <div class="content-wrap">
                            <p class="date"><?php echo date('d M Y',strtotime($value['publish_date'])); ?></p>
                            <h1 style="min-height:48px;"><?php echo substr($value['post_title'],0,40); ?> <?php echo(strlen($value['post_title'])>40)?'...':''; ?></h1>
                            <a href="<?php echo base_url('article-detail/'.url_title(strtolower($value['post_title'])).'/'.$value['id']); ?>" class="btn btn-primary"> <span> Read More <div><img src="<?php echo base_url(); ?>assets/user/img/btn-right.png" class="img" alt="right"> </div> </span></a>
                        </div>
                    </div>
                </div>
            <?php } } ?>         
            <div class="text-center">
                <nav aria-label="Page navigation example">
                    <!-- <ul class="pagination justify-content-center mt-md-4 mt-4 mb-3">
                        <li class="page-item"><a class="page-link active" href="#">1</a></li>
                        <li class="page-item"><a class="page-link" href="#">2</a></li>
                        <li class="page-item"><a class="page-link" href="#">3</a></li>
                        <li class="page-item"><a class="page-link" href="#">4</a></li>
                    </ul> -->
                    <?php echo $this->pagination->create_links(); ?>
                </nav>
            </div>
        </div>
    </div>
</div>