Kyle
Kyle

Reputation: 3042

How do I limit the number of results I get?

I already have a limit 20. But how do I also limit the page numbers?

http://img706.imageshack.us/img706/2299/28288114.png

I'm trying to display the first 5 pages than have a ...[$lastpage]

So it would display like this:

1 2 3 4 5 ... 64

How would I do that? Thanks.

Upvotes: 1

Views: 140

Answers (2)

uadnal
uadnal

Reputation: 11435

Use a counter when you loop through printing each page number....limit it to 5 or whatever number. Use an if statement to print only if the counter is >= 5 or the last page number.

Upvotes: 1

Scott Stafford
Scott Stafford

Reputation: 44776

Copy someone else's logic. For instance: http://d-scribe.de/webtools/jquery-pagination/demo/demo_options.htm

Upvotes: 2

Related Questions