Page numbering for a blog

28 views Asked by At

I am building a blog for someone atm I'm not using anything like Wordpress etc..

My question is: how can I make a page numbering system as you see in many blogs?

Thanks in advance!

1

There are 1 answers

1
daxter1992 On BEST ANSWER

If you're making everything by hand and want pagination, you can try this (assuming you're using SQL):

  1. decide the number of items you want per page
  2. query the db to get total number of items
  3. calculate total number of pages to know how many page links to print
  4. query for items by using LIMIT and OFFSET