Re: [esteban] PAGINATION limit
Hi esteban,
A lot of websites will only show you a certain number of pages in both directions from the current page (e.g. if you are on page 7, you might see 4,5,6,[7],8,9,10). This still allows users to navigate all the pages, but doesn't overwhelm them with too many numbers. Is this what you want to do?
If so, try replacing this line:
<?php foreach (range(1,$newsMetaData['totalPages']) as $page): ?>
with this:
<?php
$startNumber = max($current_page - 3, 1);
$endNumber = min($current_page + 3, $newsMetaData['totalPages']);
?>
<?php foreach (range($startNumber,$endNumber) as $page): ?>
I hope this helps! Please let me know if you have any questions or if this doesn't address your issue.
All the best,
Chris