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

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

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.