Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Divi Tutorial – Disabling Footer on Front Page

How do I hide the footer ONLY on the front page?

On a Facebook Divi community, I saw a question:

How do I hide the footer ONLY on the front page?

That sounded simple enough.

So I replied with a simple css fix from my phone:

In the page-specific custom css section, add

#main-footer {display: none;} 


Of course, that worked. A simple, dirty method.

Case closed?

However, Raphael Sanchez brought up a valid argument.

It’s not good to fully render an element and then just hide it.

(I’m paraphrasing here)

and yes, that is a good argument.

Warning: From this point on, I advise you to use a child theme 100%. No excuses. If you need a good Divi child theme click here.

So, I suggested using a php if clause..

I guess Raphael was thinking the same thing because he came back with this:

(the comments were slightly edited for clarity, also the original code had an OR, I had to change it to an &&)

Now, the thing is, the code above is just an example. It’s not the actual code for Divi’s footer.

So, taking Divi’s footer.php, and adding another idea:

(Note: I left the bottom credits section because without it, it would look weird. If you use a blank template, it’ll disappear because that’s what the blank template does.)

If you’re not going to use the “blank page” template anyway, then change your footer.php to this:

If you do use the “blank page” template, then change your footer.php to this:

So there you have it. Have fun!

If you want to learn how to add custom footers, click here.


To learn more about CSS, check out this comprehensive course that covers everything about using CSS with Divi! (use coupon code "getcoursewith5off" for 5% off) Start learning proper CSS for Divi



    Hi! Please consider signing up for my newsletter for... the occasional email about news, updates, and special offers, including child themes and more courses. Sound interesting? The signup form is right here!

    You will also get a 10% discount coupon in your inbox as soon as you sign up!


    Code credit: Raphael Sanchez
    (Although we were brainstorming methods to do this and we both came up with the idea around the same time, Raphael posted the pen, and I’m using it with his permission, so he gets 99% of the credit.)

    Photo by Vicko Mozara on Unsplash

    Default image

    Hi, I'm a front-end WordPress developer, and UI/UX designer living in Australia, and I made this website to share thoughts and tips about web design and everything related to it. If you want to work with me come check out my web development agency.

    Articles: 79

    Leave a Reply

    Your email address will not be published.