T
T
twentytvvo2021-01-22 03:37:15
WordPress
twentytvvo, 2021-01-22 03:37:15

What's wrong with pagination in Woo?

I can't figure out how to implement pagination here

<?php
$loop = new WP_Query( array(
'post_type' => 'product',
'posts_per_page' => '12',
'orderby' => 'menu_order',
'order' => 'ASC',
));

while ( $loop->have_posts() ): $loop->the_post(); ?>

<div <?php post_class("catalog-block"); ?>>
<a href="" class="image"><?php the_post_thumbnail("thumbnail-215x300"); ?></a>
<div class="name"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
<?php woocommerce_template_loop_price(); ?>
<?php woocommerce_template_loop_add_to_cart(); ?>
</div>

<?php endwhile; wp_reset_postdata(); ?>

I understand that there is a problem on the surface, but I'm a June, and I also "blurred my eyes" with solutions from Google, which did not help me.
I need pagination in the usual format like 1,2,3 and arrows on the sides, and also "load more".
I would be very grateful for a link to a real solution or, ideally, code.
And another question, can I subsequently hang up the loading of posts with Ajax?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-01-22
@artzolin

What do you want to do? Wookomers already has all the templates, cycles, pagination, shortcodes. There is no need to invent anything
About ajax loading of posts/products on the network, there are tons of articles, videos and plugins
And the_post_thumbnail()it does not accept what you pass into it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question