I've many titles and the page that show it , show only 15 per page
and as the titles are more than 15 so it shows me 15 and select page below
the bad news is that the pages number are getting out of the page cause it is too many
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20---> ect
(goes out the page)
so how can i resize it to be as following
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
(pages number 10 ber line)
here is the code that responsible to show the pages number
Code: Select all
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\">Previous</a>";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i";
} else {
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a>";
}
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next</a>";
}thanks so much