0

I'm interested in how to make the pagination working. I tried everything, but it didn't work. I tried after while echo paginate_links() and still nothing... I don't understand

This is navigation to filter ALU, PVC or ALL doors

<article id="post-<?php the_ID(); ?>" <?php post_class('container-fluid py-5'); ?>>

    <div class="container py-5">
        <div class="section-title position-relative text-center">
            <h6 class="text-uppercase text-primary mb-3" style="letter-spacing: 3px;">Was wir haben</h6>
            <h1 class="font-secondary display-4">Katalog</h1>
        </div>

        <!-- FILTERS -->
        <div class="filters" id="productsDoorsSelect">
            <p>Kategorien</p>
            <span class="filter btn btn-primary text-uppercase" data-filter="all">ALL</span>
            <span class="filter btn btn-primary text-uppercase" data-filter="alu">alu</span>
            <span class="filter btn btn-primary text-uppercase" data-filter="pvc">pvc</span>
        </div>
        <!-- FILTERS -->    

    </div>

This is query for custom post type

<!-- PRODUCTS DOORS -->
    <div class="container py-5 projects">
        <div class="row-products" id="doorsProducts" >
        <?php
            $productsQuery = new WP_Query (array(
                'post_type' => 'products_catalog'
            ));
            if($productsQuery->have_posts()):
                while($productsQuery->have_posts()):
                    $productsQuery->the_post();     
        ?>
            <div class="col-lg-4-products mb-3 project" data-filter="<?php the_field('doors_category_field') ?>">
                <div class="product-item mb-2">
                    <div class="product-img">
                        <img class="img-fluid" src="<?php the_post_thumbnail_url() ?>" alt="">
                        <a type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLong<?php the_title()?>">
                            <i class="fa fa-2x fa-plus text-white"></i>
                        </a>
                    </div>
                    <div class="bg-secondary text-center p-4">
                        <h3 class="m-0"><?php the_title() ?></h3>
                    </div>
                </div>
            </div>
            <?php endwhile; endif; ?>
        </div>
    </div>
    <!-- PRODUCTS DOORS -->

This is modals (after click on element modal with details)


    <!-- Modal -->
    <?php
        $productsQuery = new WP_Query (array('post_type' => 'products_catalog'));
        if($productsQuery->have_posts()):
            while($productsQuery->have_posts()):
                $productsQuery->the_post();     
    ?>
    <div class="modal fade" id="exampleModalLong<?php the_title() ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle"
        aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLongTitle"><?php the_title() ?></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                

                    <?php the_post_thumbnail('post-thumbnail', ['class' => 'img-fluid mb-4']); ?>
                    <?php the_content();?>
                </div>
            </div>
        </div>
    </div>
    <?php endwhile; endif; ?>
    <!-- Modal -->
Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
  • Have you tried this? https://stackoverflow.com/a/38939382/231316 – Chris Haas Aug 05 '22 at 13:11
  • Well i did make it and it works but now the filters are not saved... i have ALL ALU PVC and when i get on another page the filters are not saved Example i click on ALU and i go to another page (expample 5 for next 10 products) the filter is ALL again – Emil Kramar Aug 06 '22 at 10:38
  • You can create a cookie with Javascript to remember which filters the user had selected, and automatically select them on pageload if the cookie is set (check with php) – Jack Perry Aug 08 '22 at 04:38

0 Answers0