How to hide Footer for one page only?

Hello out there.

Is there an HTML code that allows my Footer to hide on one specific page (my Home page) without changing the Footer being displayed on all my other pages?

Right now if you do anything to the Footer, it happens on ALL pages. But I need it hidden just on my Home page.

Thank you for your help!

  • Wix User Newbie
1 Like

Hi, deb.

Would the following in your page code work for you?

$w.onReady(function() {
$w(“#nameOfControlInFooter”).style.display = (wixLocation.prefix() === ‘home’ : ‘none’ ? ‘block’);
});

?

1 Like

Thank you for trying, but no.

An error message says ‘Unexpected Token’ and points to the colon after ‘home’ :

The name of my Footer is #footer

What is the name of your home page?

It’s not published yet because I’m still playing around with ideas.
Nothing is in my Footer tho except a simple text box, so nothing complicated there.

Here’s a thought: only for the Home page, in the page-level onReady() function:

$w.onReady(function() {
$w(" #nameOfSimpleTextBoxInFooter ").style.display = ‘none’;
});

Ok. Tried that but error says:
’style‘ does not exist on ‘#text3

The name of my Text Box is #text3

And it’s just plain text in there… no special effects.

Hi!

I’m not sure what are you trying to achieve and if my following suggestion doesn’t work for you, please elaborate on your goal so we can find a suitable solution.

In your site structure (the white list to the left of all the pages in your site) click on the page settings of the desired page. ( > )


then in the ‘Layout tab’ you have an option to remove the footer & header from a certain page.

If its only the ‘#text3’ element that you’re trying to hide I’d recommend to use the following code ( V ):

$w.onReady(function() {
    $w("#text3").hide()
});

Hope it helps!

Doron.

1 Like

YEEESSSS !! The second option works… well sort of… but only with adjustments to the other pages.

The problem with the first option – removing the Header and Footer in the settings – is that they are combined and not separate. I need JUST my Footer not to be shown… but this feature also hides my Header as well, unfortunately.

(I wish Wix would separate those 2 elements so you could pick one or the other, or both. Think I might suggest that for their Wix “Voting List” and see if they can change it for the future.)

Anyway…
Your second suggestion of code worked like a charm, but not fully.

In the Developer Console I put your code just on my Home page AND just in the tab for “Page Code”… NOT on the tab for “Site Code”.

When I save and hit ”Preview” mode I see that the Footer on the Home page is gone. YAY! But it’s also gone from all my other pages, too. Not good.

So I tried putting your same code on ALL my other web pages BUT instead of the word ‘hide’ I replaced it with the word ‘show’ and that worked !!! YAY !!! :smiley:

$w.onReady ( function ( ) {
$w(“#text3”) .show ( )
});

Thank you Doron and abergquist both for taking the time to help me !!!
I really do appreciate it !

  • Wix User Newbie

I agree with you, Deb; the ability to display/invisible-ize Header and Footer should be separated so that, in addition to the ‘Standard’ option on the ‘Layouts’ tab … the other option could either be implemented:

  1. as an option/radio button and 2 checkboxes:

( ) No Header and/or Footer
[ ] No Header
[ ] No Footer

or

  1. as 3 additional options/radio buttons:

( ) No Header
( ) No Footer
( ) No Header and no Footer

The last one above could be replaced with what currently displays, viz.:

( ) No Header & Footer

Exactly! I’ll request that and hopefully it will get implemented.
Thanks again !

Any update with the request?