0

So basically the title. My theme is Elementor.

I created a page template and without the header and footer the styling is completely messed up. How can I make it so I don't need the header and footer?

Many thanks!

1 Answer 1

1

To replace get_header(), copy the code from theme's header.php into your page template, and to replace get_footer(), copy the code from theme's footer.php into your page template.

5
  • Thanks for the response! So I did what was mentioned and header.php contained HTML code, so it didn't format correctly and the styling remained the same. Commented Jul 20, 2023 at 12:23
  • Make sure you copy and paste correctly, for instance, HTML code should not go inside of PHP tags.
    – Caleb
    Commented Jul 20, 2023 at 12:25
  • The HTML code wasn't inside the tags and the formatting remained the same. It seems like it might be a thing where it requires the functions get_header() Commented Jul 20, 2023 at 12:27
  • The main functions you need to check are present are wp_head() in between the <head> tags, and wp_footer() before the closing <body> tag.
    – Caleb
    Commented Jul 20, 2023 at 13:42
  • Ahhh I looked at the wrong header.php and footer.php file. Works like a charm! Thank you very much Commented Jul 20, 2023 at 19:58

Your Answer

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

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