Specialized template for subpages?

If I have a page named ‘events’ (of which the specialized template will be named ‘page-events.php’), is there any way to have a specialized template of a subpage ‘events/event-sub-page’?

I can’t seem to find how to do it in the documentation here: codex.wordpress.org/Page_Templates.

Related posts

Leave a Reply

2 comments

  1. You would just create a new template called events-subpage.php and build it accordingly. Then when making your page in wordpress, select the template events-subpage.

  2. You can just create the “event-sub-page” page in WordPress, set its parent to the “events” page, and make your custom template file “page-event-sub-page.php” (no need to specify the “events” part in the actual php filename)

    Or in my case I wanted “../login” for a specialized login form and “../login/recovery” for password recovery. The template page is simply “page-recovery.php”