0

As the title suggests, I'd like a page template to have NO navigation and NO footer.

All my page templates have this:

<?php
 /*
   * Template Name: Blah Blah
 */

 if (!defined('ABSPATH'))
  exit; // Exit if accessed directly
 get_header();
 ?>

But if I remove the above code then the entire page won't work.

1
  • downvoted and close voted as this will be totally theme dependent. (bravokeyl answer is really the best answer possible but it is only the starting point) Aug 8, 2017 at 7:34

1 Answer 1

5

Don't remove get_header().

Duplicate the header.php to header-{custom-name}.php, let's say (header-nonavfooter.php) then in the template file replace get_header() with get_header('nonavfooter').

In the new header file (header-nonavfooter.php) remove the code related to navigation.

Do the same for the footer.php also(Create a new footer.php and remove the footer parts that you don't need), remember not to remove wp_footer() available in footer.php.

1
  • the "get_header('nonavfooter')" idea worked great - but I can't seem to find how and where the footer is called. * sorry - i figured it out :)
    – Henry
    Aug 9, 2017 at 11:42

Your Answer

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

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