this is more of a maths question than anything but still related.
So,
I have a basic cms that displays 4 blog posts on each page. The page number is in the url so i can get that.
I am trying to number the results using $variable++ in a foreach loop however that of course resets back to 1 when the new page is loaded.
Example for page 1:
$postNumber = 1;
foreach:
echo "$postNumber";
$postNumber++;
endforeach;
Now the issue comes when going to page 2.
I need to come up with a way to take the page number and then create the next set of post numbers.
So the post numbers / page numbers needed would be:
Page Number / Post start number
1 / 1
2 / 5
3 / 9
4 / 13
5 / 17
6 / 21
7 / 25
etc
The gap in between each page number / post numbers increases by 3 every time (0,3,6,9,12,15 etc)
Maths isn't my strong points, or maybe because its late... but i cant figure out a way to do this. Make sense?