I created a page template that removes the navigation and footer coder (while still keeping the call to the style sheet and any javascript) and it works when I am logged into wordpress, but when I log out of wordpress it doesn't seem to function. Here are some screenshots:

Logged in (what I want the page to look like at all times):

enter image description here

Logged out (not correct, the page should not have the navigation or footer):

enter image description here

The way I generated this template was by starting with a page template I currently have, adding in the header and footer code (instead of calling to it) and deleting the navigation content and the footer content from the code.

Is there something I may have removed in the code that specifies what template to use if a wordpress user is logged in/out?

Here is the code I removed from the header:

Code removed from header

Here is the code I removed from the footer:

Code removed from footer

I am using a built child them of the Wizard Theme

  • Hi, Which theme are you using ? And can you paste the code that you removed?
    – colbyalbo
    Aug 6 '19 at 21:29
  • I updated the information and added links to the code I removed as well as a link to the theme I am using (Wizard - Child theme) Aug 7 '19 at 0:09
  • I noticed that when I update my page php file to - get_header( 'nonavigation' ) - and I create a header-nonavigation.php file and upload it to the server my site correctly loads the changes, but then removes the changes and reverts back to the header.php file code. Do you know what could be causing this? I have cleared my cache and tried reloading, but I get the same results. Aug 7 '19 at 0:26
  • I figured out the solution. I'll mark it in a comment below. Aug 7 '19 at 0:42
  • great, glad you got it working
    – colbyalbo
    Aug 7 '19 at 14:14

I found the solutions:

I created a duplicate header and footer file named them header-nonavigation.php and footer-none.php

In these files, I deleted the navigation code and the footer code (do not hide the navigation/footer for some reason it won't load the correct php header/footer files)

I called to these files in my page template php file as get_header('nonavigation') and get_footer('none').

This accomplished exactly what I needed. Whether I am logged in or out the navigation and footer no longer appear.

Here is a screenshot:

enter image description here

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.