Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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'] ?

share|improve this question
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. –  m0r7if3r Mar 11 '12 at 20:29
    
yep, it works! thank you :) –  greenbandit Mar 11 '12 at 23:01
1  
Outstanding, I submitted it as an answer so you can mark it as the solution. –  m0r7if3r Mar 11 '12 at 23:06
add comment

1 Answer 1

up vote 2 down vote accepted

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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