Use Elementor Footer without Header

During my first steps with Elementor and ElementorPro I came accross this issue/feature. When you use Elementor to create your page footer it also removes the page header which was not intended in my case.

The reason is described somewhere in a github issue:
Many themes open some HTML tags in the header and close these tags in the footer again so if you use the following code example make sure your theme doesn’t.

// GET MY HEADER BACK
add_action( 'elementor/theme/register_locations', function(){
  $elementor_theme_support = \ElementorPro\Plugin::instance()->modules_manager->get_modules('theme-builder')->get_component( 'theme_support' );	
  remove_action( 'get_header', [ $elementor_theme_support, 'get_header' ] );
}, 100);

5 Responses to “Use Elementor Footer without Header”

  1. Cihat

    Hi. I have the same problem as yours. I built a footer with elementor but lost theme’s header. Tried the code you give and it works. Now I have the header back. But there is another problem. Footer area is not full width any more. It falls into container.

    It would be great if you could help.

    tarisera.com

    Reply
  2. Hannes

    This question is a little bit too specific…
    Maybe your theme opens some HTML tags in header.php which are closed in footer.php so the HTML structure isn’t correct anymore.

    Reply
    • Cihat

      Actually I got it to work by adding some CSS. Thanks anyway. I couldn’t do it without your codes. Let me add the CSS for the ones who came across the same problem. Hope it works for them as well.

      .elementor-location-footer {
      width: 100vw;
      position: relative;
      margin-left: -50vw;
      left: 50%;
      }

      Reply
  3. Florian

    Hello,

    your code works great. However, I still have the problem with my separate mobile header. Do you have a solution for that too?

    Thanks

    Reply
    • Hannes

      Hello,
      I think this is too dependent on your site for a general answer…

      Reply

Leave a Reply