<?php get_header();
/**
 * Template Name: All Notice
 */
$current_language = pll_current_language(); ?>
    <section class=" my-5">
        <div class="faculty-profile-banner d-flex justify-content-center align-items-center text-center"
             style="background-image: linear-gradient(rgb(37 59 128), rgba(1, 39, 11, 0.75)),url(<?php echo get_site_url(); ?>/wp-content/uploads/2024/07/IMG-20240728-WA0000.jpg) ">
            <h1 class="fs-1 fw-bolder text-white font-poppins text-center"><?php echo pll_e('Notice') ?></h1>
        </div>
    </section>
    <main class="container">
        <section>
            <div class="container">
                <div class="row">

                    <?php
                    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                    $args = array(
                        'post_type' => 'notice',
                        'posts_per_page' => 10,
                        'paged' => $paged,
                        'lang' => $current_language
                    );
                    $loop = new WP_Query($args);
                    $post = $loop->have_posts();
                    while ($loop->have_posts()) {
                        $loop->the_post();


                        get_template_part('template/notice_page', get_post_format());
                    }
                    ?>


                </div>

                <div class="row ">
                    <div class="col-sm-12 news-pagination">
                        <nav>
                            <?php
                            $big = 999999999; // need an unlikely integer
                            $total_pages = $loop->max_num_pages;

                            if ($total_pages > 1) {
                                $current_page = max(1, get_query_var('paged'));

                                $pages = paginate_links(array(
                                    'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
                                    'format' => '?paged=%#%',
                                    'current' => $current_page,
                                    'total' => $total_pages,
                                    'type' => 'array',
                                    'prev_text' => __('« Previous', 'textdomain'),
                                    'next_text' => __('Next »', 'textdomain'),
                                ));

                                if (is_array($pages)) {
                                    echo '<ul class="pagination">';
                                    foreach ($pages as $page) {
                                        // Add 'page-link' class to each pagination link
                                        echo "<li class='page-item'>" . str_replace('page-numbers', 'page-numbers page-link', $page) . "</li>";
                                    }
                                    echo '</ul>';
                                }
                            }
                            ?>

                            <!--<ul class="pagination">

                                <li class="page-item disabled" aria-disabled="true" aria-label="&laquo; Previous">
                                    <span class="page-link" aria-hidden="true">&lsaquo;</span>
                                </li>
                                <li class="page-item active" aria-current="page"><span class="page-link">1</span></li>
                                <li class="page-item"><a class="page-link" href="all4658.html?page=2">2</a></li>
                                <li class="page-item"><a class="page-link" href="all9ba9.html?page=3">3</a></li>
                                <li class="page-item"><a class="page-link" href="allfdb0.html?page=4">4</a></li>
                                <li class="page-item"><a class="page-link" href="allaf4d.html?page=5">5</a></li>
                                <li class="page-item"><a class="page-link" href="allc575.html?page=6">6</a></li>
                                <li class="page-item"><a class="page-link" href="all235c.html?page=7">7</a></li>
                                <li class="page-item"><a class="page-link" href="allfdfa.html?page=8">8</a></li>
                                <li class="page-item"><a class="page-link" href="all0b08.html?page=9">9</a></li>
                                <li class="page-item"><a class="page-link" href="all1448.html?page=10">10</a></li>

                                <li class="page-item disabled" aria-disabled="true"><span class="page-link">...</span>
                                </li>


                                <li class="page-item"><a class="page-link" href="all9683.html?page=18">18</a></li>
                                <li class="page-item"><a class="page-link" href="all7537.html?page=19">19</a></li>


                                <li class="page-item">
                                    <a class="page-link" href="all4658.html?page=2" rel="next"
                                       aria-label="Next &raquo;">&rsaquo;</a>
                                </li>
                            </ul>-->
                        </nav>

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

    </main>
    <!-- Content Here -->
<?php get_footer(); ?>