Displaying pagination | WordPress.org

[ad_1]

Hi @brookft,

It might be best to ask WooCommerce regarding this:

Hi, thans, I did but they said to contact the theme author.

Hi there,

the theme doesn’t interfere with the display of the woocommerce pagination template. We leave it to Wooommerce and it uses this template:

https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/templates/loop/pagination.php

The templates header provides info on how to override that in your Child Theme. ie. which folder to place a copy of the pagination.php template in.

And on line 27 – 29 you will see:

if ( $total <= 1 ) {
	return;
}

replace that with this:

if ( $total <= 1 ) {
	?>
	<nav class="woocommerce-pagination">
		<ul class="page-numbers">
			<li><span aria-current="page" class="page-numbers current">1</span></li>
		</ul>
	</nav>
	<?php
	return;
}

So when there is no pagination it will print just the current page.

Thank you so very much! I also thought that the theme does not change the pagination, I think Woocommerce’s support likes to make it easy for themseves and always say to ask other theme and plugin authors 😉

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer