I’m using Magento 2.2, and I’m wondering, how would I remove the header and footer ONLY from the home page? I use various stores, so the home page just acts as a portal to each store.
I explicitly only want to remove the header and footer from the home page. They should appear on all other pages.
Thank you.
3
Answers
I’m sure there are other ways of not rendering the content in the backend code, but you can certainly do it in CSS as well.
If you’re looking for a code solution, I believe you would override one of the xml layout files to do this. It has been a while since I have done anything with Magento, so I’m not sure if that’s possible, but it should be if I remember correctly.
This looks like it could be a good example to go on for removing it using the layout xml option: How to remove ‘Subscribe’ field from Luma footer
The beste way of doing this is to remove the header and footer from your XML-Rendering file. If you only hide it with CSS then this section will be rendered and need some resources. You can try something like this:
You need to overwrite cms_index_index.xml layout. Then it will apply change only to home index page