Skip to content

Commit

Permalink
Merge pull request #663 from bootscore/Fix-WC-pagination
Browse files Browse the repository at this point in the history
Fix WC pagination.php
  • Loading branch information
justinkruit committed Jan 7, 2024
2 parents 8c4154f + eeb6599 commit 8469c55
Showing 1 changed file with 44 additions and 6 deletions.
50 changes: 44 additions & 6 deletions woocommerce/loop/pagination.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* Pagination - Show numbered pagination for catalog pages
*
Expand All @@ -11,7 +10,7 @@
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @see https://woo.com/document/template-structure/
* @package WooCommerce\Templates
* @version 3.3.1
*/
Expand All @@ -29,7 +28,46 @@
return;
}
?>
<!-- Pagination -->
<div>
<?php bootscore_pagination(); ?>
</div>
<nav aria-label="wc-navigation">
<?php
$paginate_links = paginate_links(
apply_filters(
'woocommerce_pagination_args',
array(
'base' => $base,
'format' => $format,
'add_args' => false,
'current' => max(1, $current),
'total' => $total,
'prev_text' => '&laquo;',
'next_text' => '&raquo;',
'type' => 'array',
'end_size' => 1,
'mid_size' => 1,
)
)
);

if (is_array($paginate_links)) {
?>
<ul class="pagination justify-content-center">
<?php
foreach ($paginate_links as $paginate_link) {
// Replace 'page-numbers' with 'page-link' and 'current' with 'active'.
$paginate_link = str_replace(array('page-numbers', 'current'), array('page-link', 'active'), $paginate_link);
?>

<li class="page-item">
<?php
echo wp_kses_post($paginate_link);
?>
</li>

<?php
}
?>
</ul>
<?php
}
?>
</nav>

0 comments on commit 8469c55

Please sign in to comment.