1

I have a page called my-todo-list and is using a custom page template.

The page is accessible via this type of URL : http://domain.com/my-todo-list/

Now I need to paginate it, and I want to look like this: http://domain.com/my-todo-list/page/1

I've read a lot of questions here, but nothing clear.

Any Ideas to make it possible? my template needs something like$page= $_GET['page'] ?

2
  • 4
    You'll actually want to use get_query_var( 'paged' ), not $_GET[], as there are no parameters in the URL, since it has been rewritten.
    – mor7ifer
    Mar 11, 2012 at 20:29
  • 1
    Outstanding, I submitted it as an answer so you can mark it as the solution.
    – mor7ifer
    Mar 11, 2012 at 23:06

1 Answer 1

2

What you will want to use is get_query_var( 'paged' ). This will get the default pagination value, this should be set by default, so you should just be able to plug and play. Because there are no URL parameters due to rewriting, $_GET[] will be completely empty (at least on the example URLs).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.