pagination not working
-
hi, I updated the woocomerce plugin. but pagination is not working in categories page. It is showing 404 error. I am using “previous_posts_link);” and “next_posts_link();” please suggest me what to do with that?
-
please suggest me what to do? because after clicking 2nd page. it shows 404 page.
hi, woocommerce pagination is not working after updating woocomerce plugin. it gives 404 error. please suggest me what to do?
Hi @adil1641,
Does the problem only happen with your custom
previous_posts_link();andnext_posts_link();or with default WooCommerce pagination too? By default WooCommerce uses the paginate_links function instead of those two. You can find an example of how it’s used in templates/loop/pagination.php.Cheers!
hi, the problem is occurring in both. In templates/loop/pagination.php. I have used
global $wp_query;if ( $wp_query->max_num_pages <= 1 )
return;
?>
<nav class=”woocommerce-pagination”>
<?php
echo paginate_links( apply_filters( ‘woocommerce_pagination_args’, array( // WPCS: XSS ok.
‘base’ => str_replace( 999999999, ‘%#%’, get_pagenum_link( 999999999 , false ) ),
‘format’ => ”,
‘add_args’ => false,
‘current’ => max( 1, get_query_var( ‘paged’ ) ),
‘total’ => $wp_query->max_num_pages,
‘prev_text’ => ‘←’,
‘next_text’ => ‘→’,
‘type’ => ‘list’,
‘end_size’ => 3,
‘mid_size’ => 3,
) ) );
?>
</nav>but still 404 error occurs in 2nd page. please suggest me what to do with this error?
It occurs in product category page. please suggest me what to do?
Can you please go to Settings > Permalinks in WP Admin and click Save Changes? This should regenerate all links in WordPress, including the ones for category pages.
If this doesn’t help, please send me a screenshot of Optional and Product permalinks sections on that page? Here is an example: http://cld.wthms.co/Rg426C
A link to a sample category page would be helpful too.
Thanks!
hi, @madeincosmos currently not resolved. I used <?php
echo paginate_links( apply_filters( ‘woocommerce_pagination_args’, array( // WPCS: XSS ok.
‘base’ => $base,
‘format’ => $format,
‘add_args’ => false,
‘current’ => max( 1, $current ),
‘total’ => $total,
‘prev_text’ => ‘←’,
‘next_text’ => ‘→’,
‘type’ => ‘list’,
‘end_size’ => 3,
‘mid_size’ => 3,
) ) );
?>
in place of previous post links function. still 404 error. and the link you share with me above. all fields are same except two fields.
1) “product-category” value is given to Product category base input field
2) “/shop/” value is given to custom base input field.
i can,t share because it is on localhost.
please suggest me what to do ?hi, @madeincosmos
https://www.creativesystems.com/product-category/play-systems/ant-hill/
please check the live link. I have to downgrade plugin to this older version.
please suggest me what to do?@adil1641 this looks to be working now, do you still need help?
We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.
The topic ‘pagination not working’ is closed to new replies.