<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">Baking Class </h1>
                    </div>
                </div>
                <div class="col-md-8">
                    <img src="<?php echo base_url(); ?>assets/user/img/service-details-banner.webp" alt="services" class="w-100">
                </div>
            </div>
        </div>
    </div>
</div>
<div class="all-classes">
    <div class="container">
        <div class="row">
            <div class="col-lg-12 mb-5 position-relative">
                <a href="<?php echo base_url(); ?>services" class="go-back-two">
                    <img src="<?php echo base_url(); ?>assets/user/img/back-one.webp" alt="back" class="img-fluid me-2" width="60"> Back
                </a>
                <h2 class="main-title text-center  mb-lg-4">
                    Upcoming Classes
                </h2>

            </div>
            <?php if (isset($blog) && $blog) {
                foreach ($blog as $key => $value) { ?>
                    <div class="col-lg-4 col-md-4 col-sm-6 mb-5">
                        <div class="class-box text-center">
                            <div class="img-wrap mb-3">
                                <?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/class1.png" class="img-fluid" alt="recipe image">
                                <?php } ?>
                            </div>
                            <div class="content-wrap">
                                <p class="mb-4"><?php echo $value['post_category']; ?></p>
                                <h1 class="class-name mb-4" 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('class-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="col-lg-12 ">
                <div class="text-center">
                    <nav aria-label="Page navigation example">
                        <!-- <ul class="pagination justify-content-center mt-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>
</div>