skip to Main Content

I have wordpress website and I want any page that is accesed with /no_header to be shown without header and footer, basically to hide those two sections. I’m new to php/wp and I don’t know how to tackle the problem.

Example:

  1. testsite.com/about -> shown normal like it is
  2. testsite.com/about/no_header -> shown without header and footer, only the content.

Edit: I mention that I have Elementor Pro and WPRocket installed, if that helps or it’s relevent in a way.

2

Answers


  1. If you have Elementor, you shouldn’t need to go to the code.
    For all of its downsides, this type of flexibility is one of its perks.

    In the pages where you don’t want header and footer, look for the Page Attributes on the right sidebar, as shown here:

    https://www.josevarghese.com/wp-content/uploads/2019/03/Elementor-Canvas-for-Hiding-Header-and-Footer.png

    Elementor Canvas should hide the header and footer on the pages where it is selected as the Template.

    Login or Signup to reply.
  2. I would find some selectors that identify the header and footer (like an id, or a class that is used a single time) and would write some CSS file that would have display: none; for them. When the page is loaded with no header/footer, then I would load that CSS file into the head tag.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search