This might be a quite silly question, but I can’t figure anything out that might help me go further. I’m looking to shorten the number of NUMBERS in my page navigation.
Instead of being like: 1, 2, 3, 4, 5, 6, 7, 8
I want it be like: 1, 2…7, 8
And when I go to 2, number 3 should now be seen in the numbers group.
Here is my code that is in charge of the page numbers:
<div id="user_nav_bottom">
<?php for($i=1; $i < sizeof($pages)+1; $i++) {
$strong = ($_GET['page'] == $i) ? ' dark bold' : '';
echo '<span class="normal' . $strong . '"><a href="imgit_images.php?page=' . $i . '">' . $i . ', </a></span>';
} ?>
</div>
This is a modified chunk of code I wrote for paging forums.
It’s output isn’t exactly how you showed but should just be a matter of tweaking.