Apologies if this has been answered already - I have singularly failed to word my question in a way that Google can help.

I'm trying to create a page that acts as a base URL for a range of items with numbers - those items won't have pages, but rather than


I'd like to create


Capturing the ID number in variable form and forcing all instances with that 'page-name' to be handled by a single template. I've seen WooCommerce do something like this, and am currently searching the codebase to try and figure it out, but any pointers would be appreciated.

1 Answer 1


The rewrite rule already exists to handle those requests, it's for pagination of a single page post type. You can get the value of the page number with get_query_var('page'). You can render all pages with the same template by creating a page-{page-name}.php template file.

  • Thank you - appreciated. Follow up question: any idea how you'd detect a worded child rather than a numbered one? May 25, 2015 at 14:55
  • 1
    you'd have to add your own rewrite rule. there should be some questions/answers here regarding that, if you look around.
    – Milo
    May 25, 2015 at 15:10

Your Answer

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

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