I have a page template that I want to be able to show in two different modes: a regular mode and a bare-bones mode, where there is no header, footer, sidebar, etc. My hope is that I can get this done using a parent-child url, like so:

Normal view: http://sample.com/mypage/

Barebones view: http://sample.com/mypage/clean/

I assume I will need to edit header.php as well as footer.php to check whether or not they should show up, but how do I figure out the parent-child relationship, or is there an easier way to get this done?


Add an endpoint to your post permalink, name it clean.

In your callback for template_redirect use a special header.php or none at all. Do not forget to call exit;; otherwise WordPress will load the default template files later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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