I have a simple pagination script:
$product_nr = count($query); // counts the number of products
$totalpages = ceil($product_nr / $rowsperpage);
if ($currentpage > $totalpages){ $currentpage = $totalpages; }
$offset = (($currentpage - 1) * $rowsperpage);
The code is set to show 20 rows per page -> $rowsperpage = 20;
I need an idea on how to show only 18 rows on the first page ONLY and add the remaining 2 rows to the $product_nr so it won’t brake the 20 rows per page pagination for the other pages.
Basically:
1st page - 18 rows;
the other pages would show 20 rows per page from the remaining rows.
Any ideas?
if possible you can set. $rowsperpage separately when on first page ie if $currentpage == 1 then $rowperpage=18
and for all other pages you’ll have to set the offset -2
i.e